Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Age Calculator Want to find out how old you'll be? Calculate it! Store your birth year in a variable. Store a future year in

1. Age Calculator

Want to find out how old you'll be? Calculate it! Store your birth year in a variable. Store a future year in a variable. Calculate your 2 possible ages for that year based on the stored values. For example, if you were born in 1988, then in 2026 you'll be either 37 or 38, depending on what month it is in 2026. Output them to the screen like so: "I will be either NN or NN in YYYY", substituting the values.

2. Temperature Converter

It's cold out! Make a temperature converter based on the steps here.

Store a celsius temperature into a variable.

Convert it to fahrenheit and output "NNC is NNF".

Now store a fahrenheit temperature into a variable.

Convert it to celsius and output "NNF is NNC."

3. Dog Age Calculator

You know how old your dog is in human years, but what about dog years? Calculate it!

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.

Add an additional argument to the function that takes the conversion rate of human to dog years.

4. Geometry Functions

Create 2 functions that calculate properties of a circle, using the definitions here.

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

5. Translator Function

Write a function named helloWorld that:

takes 1 argument, a language code (e.g. "es", "de", "en")

returns "Hello, World" for the given language, for at least 3 languages.

it should default to returning English

Call that function for each of the supported languages and log the result to make sure it works.

6. The Pluralizer

Write a function named pluralize that:

takes 2 arguments, a noun and a number.

returns the number and pluralized form, like "5 cats" or "1 dog".

Call that function for a few different scores and log the result to make sure it works.

Make it handle a few collective nouns like "sheep" and "geese".

7. Even/Odd

Write a for loop that will iterate from 0 to 20. For each iteration, it will check if the current number is even or odd, and report that to the screen (e.g. "2 is even").

8. Multiplication Tables

Write a for loop that will iterate from 0 to 10. For each iteration of the for loop, it will multiply the number by 9 and log the result (e.g. "2 * 9 = 18").

Use a nested for loop to show the tables for every multiplier from 1 to 10 (100 results total).

9. Top Choices Reporting

Create an array to hold your top choices (colors, presidents, whatever- you pick).

For each choice, log to the screen a string like: "My #1 choice is blue."

Change it to log "My 1st choice, "My 2nd choice", "My 3rd choice", picking the right suffix for the number based on what it is.

Answer these 9 steps please and number them

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions