subject

Write a Python program to calculate tax and tip. Ask the user for a check amount, and calculate the tax and tip, providing tip amounts for stingy, regular, and generous customers. Use the following steps:

Prompt the user for a check amount and store it in a variable called check_amount_str.
Convert check_amount_str to a floating point number and store it in a variable called check_amount.
Calculate tax amount (7%) and three tip amounts (10%, 15%, and 20%), storing each result in a separate variable.
Calculate total for regular customers including 7% tax and 15% tip. Print the results to the console like in the example below, including the base cost of the meal, tax, three tip levels, and total for regular customers.

The expected output from your program should look like the following:
Please enter check amount: $ 20
Base cost: $ 20.00
Tax (7 %): $ 1.40
Tip for stingy customers (10 %): $ 2.00
Tip for regular customers (15 %): $ 3.00
Tip for generous customers (20 %): $ 4.00
Total with tax and tip for regular customers: $ 24.40

Note: that it’s okay for now if you have more decimals, e. g. your total might look like $ 24.40000001. We will learn how to format your output later.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. peter has launched a website that features baby products. however, clients often find they are unable to access the website because the server is down. which feature of cybersecurity should peter focus on for his website? a. data authenticity b. data privacy c. data availability d. data integrity e. data encryption
Answers: 3
You know the right answer?
Write a Python program to calculate tax and tip. Ask the user for a check amount, and calculate the...
Questions
question
Mathematics, 26.05.2021 20:00
question
Mathematics, 26.05.2021 20:00
question
Mathematics, 26.05.2021 20:10
question
Mathematics, 26.05.2021 20:10
question
Mathematics, 26.05.2021 20:10
question
Mathematics, 26.05.2021 20:10