Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Create a 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 20% tip, Ok service 15%, poor service 10%).
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.00 and $500.00 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

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions