Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. //I want to create a function called ageInSeconds which takes one parameter
  2. //that parameter is an int that I am naming 'yourAgeInYears'
  3. //the function will return an int
  4. //here is the declaration of that function
  5. function ageInSeconds(yourAgeInYears:int):int
  6. {
  7. //declare a local variable for age in days
  8. var yourAgeInDays:int=(yourAgeInYears * 365);
  9. //one for age in hours
  10. var yourAgeInHours:int=(yourAgeInDays * 24);
  11. //one for age in minutes
  12. var yourAgeInMinutes:int=(yourAgeInHours * 60);
  13. //and one for age in seconds
  14. var yourAgeInSeconds:int=(yourAgeInMinutes * 60);
  15. return yourAgeInSeconds
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement