Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //I want to create a function called ageInSeconds which takes one parameter
- //that parameter is an int that I am naming 'yourAgeInYears'
- //the function will return an int
- //here is the declaration of that function
- function ageInSeconds(yourAgeInYears:int):int
- {
- //declare a local variable for age in days
- var yourAgeInDays:int=(yourAgeInYears * 365);
- //one for age in hours
- var yourAgeInHours:int=(yourAgeInDays * 24);
- //one for age in minutes
- var yourAgeInMinutes:int=(yourAgeInHours * 60);
- //and one for age in seconds
- var yourAgeInSeconds:int=(yourAgeInMinutes * 60);
- return yourAgeInSeconds
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement