Exercise

  1. Write a function named tellFortunethat:

    • 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.
  2. Write a function namedcalculateDogAgethat:

    • 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.

  3. Create 2 functions that calculate properties of a circle.

    Create a function calledcalcCircumfrence:

    • Pass the radius to the function.
    • Calculate the circumference based on the radius, and output "The circumference is NN".

    Create a function calledcalcArea:

    • Pass the radius to the function.
    • Calculate the area based on the radius, and output "The area is NN".

results matching ""

    No results matching ""