Question: This is a JavaScript front-end web development. 1. Cost Estimator Design a program with a function. The function should calculate the cost of painting rooms

This is a JavaScript front-end web development.

1. Cost Estimator Design a program with a function. The function should calculate the cost of painting rooms in the house. Assume each room can be painted by exactly one can of paint.

i. Function:

a.Will have parameters for number of rooms and cost per can

b.Calculates and returns the cost

ii.Main Code (Inline):

a.Prompt the user for cost and number of rooms

b.Call the function, pass the 2 arguments and have the value displayed on the web page

2.MPG Estimator Design a program with a function. The function should calculate the MPG (mile-per-gallon) of the car.

a. Function:

i. Will have parameter for size of gas tank and miles drivable on a full tank (range)

ii. Will calculate and return the MPG (Mile/gallon)

b. Main Code (Inline):

i. Prompt for size of tank (in gallons0 and miles drivable

ii. Call function, passing 2 arguments (variables form previous step)

iii. Display the returned value

3. Bill Estimator Design a program with a function. The function should calculate the total bill of the user. Enter all rates (percentages) as .05 (for 5%)

a. Function:

i. Will have parameters for subtotal, tax rate, and tip rate

ii. Will calculate and display to the user the total amount due using the following formula - subtotal * tax rate is tax due; tax due + subtotal is multiplied by tip rate, then add this result to tax due and subtotal for final total

b. Main Code (Inline):

i. Prompt for Subtotal, Tax Rate & Tip Rate

ii. Call Function, Pass 3 Arguments

iii. Display the returned value

Rubric:::

Declare the parameters needed to calculate the program

Using a function, calculate the required values for the program you selected

Prompt the user in the HTML document to input information to be used in the function

Call the function and send the arguments to be used

Display the returned value to the user in a concatenate statement

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!