Exercise
Write a function named
tellFortune
that:- takes 4 arguments: number of children, partner's name, geographic location, job title.
- Outputs your fortune to the screen like so: "You will be a X in Y, and married to Z with N kids."
- Call that function 3 times with 3 different values for the arguments.
Write a function named
calculateDogAge
that:- takes 1 argument: your puppy's age.
- calculates your dog's age based on the conversion rate of 1 human year to 7 dog years.
outputs the result to the screen like so: "Your doggie is NN years old in dog years!"
Call the function three times with different sets of values.
Create 2 functions that calculate properties of a circle.
Create a function called
calcCircumfrence
:- Pass the radius to the function.
- Calculate the circumference based on the radius, and output "The circumference is NN".
Create a function called
calcArea
:- Pass the radius to the function.
- Calculate the area based on the radius, and output "The area is NN".