Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create one complete JavaScript code program that performs each task below. Include comments to explain your code. Ask the user for their first name and

Create one complete JavaScript code program that performs each task below. Include comments to explain your code.
Ask the user for their first name and store it in the variable Fname. After the user types in their name, display a welcome message that contains the name they entered.
Create the constant piValue to store the value of Pi to 7 significant digits (3.1415926).
Ask the user to input their favorite number and store the value in a variable myFavNum
Calculate the area of a circle using the users favorite number as the radius ( r )
Store the result in a new variable myArea.
The formula to find the area of a circle is A =\pi r2.
Use the value of Pi stored in the constant myPi.
Display the contents of each variable to the webpage in a message with each variable and text describing the variable. You can use any message you would like, but it must include each variable with a description. For example, if the user entered Sam and 33, the message could be:
Hello Sam, you entered 33 as your favorite number. If that was the radius of a circle, the circles area would be 311.017667.

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

Using Language That Works

Answered: 1 week ago

Question

4. Are my sources relevant?

Answered: 1 week ago