Question: Create a complete java script that calculates the amount of tip to leave for a service. Prompt the user to enter the dollar amount of

Create a complete java script that calculates the amount of tip to leave for a service.
Prompt the user to enter the dollar amount of the service and ask if the service quality was great, ok
,
or poor
(
assume great service gets a
2
0
%
tip, Ok service
1
5
%
,
poor service
1
0
%
)
.
Create a function to verify a valid service quality was entered.
If an invalid value is entered, display a message and end the code.
Create a function to verify a service amount between $
5
.
0
0
and $
5
0
0
.
0
0
was entered.
If an invalid value is entered, display a message and end the code.
Create a function to calculate the tip amount and return the value.
If valid values are entered, call the function to calculate the tip. The tip amount is displayed to the user in a descriptive message that includes the service amount, the recommended tip, and the service quality the tip is based on
.

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!