1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Reptile [31]
3 years ago
12

Create a program that calculates three options for an appropriate tip to leave after a meal at a restaurant.

Computers and Technology
1 answer:
max2010maxim [7]3 years ago
7 0

Complete Question:

Python Programming: Create a program that calculates three options for an appropriate tip to leave after a meal at a restaurant and repeats if the user enters "y" or "Y" to continue.

Print the name of the application "Tip Calculator"

- Get input from the user for "Cost of meal: "

- Calculate and display the "Tip Amount" and "Total Amount" at a tip_percent of 15%, 20%, and 25%.

- Use a FOR loop to iterate through the tip_percent

- The formula for calculating the tip amount is: tip = cost of meal * (tip percent / 100)

- The program should accept decimal entries like 52.31. Assume the user will enter valid data.

- The program should round the results to a maximum of two decimal places . At the "Continue? (y/n)" prompt, the program should continue only if the user enters “y” or “Y” to continue.

- Print "Bye!" or a salutation at the end of the program

Answer:

Answered in Python

print("Tip Calculator")

tryagain = "y"

while tryagain == "y" or tryagain == "Y":

    amount = float(input("Cost of Meal: "))

    for tip_percent in range(15,26,5):

         print(str(tip_percent)+"%")

         print("Tip Amount: "+str(round(tip_percent * amount/100,2)))

         print("Total Amount: "+str(round(amount + (tip_percent * amount/100),2)))

    tryagain = input("Continue?y/n: ")

print("Bye!")

Explanation:

This prints the name of the calculator

print("Tip Calculator")

This initializes tryagain to yes

tryagain = "y"

While tryagain is yes, the following loop is repeated

while tryagain == "y" or tryagain == "Y":

This prompts user for amount of meal

    amount = float(input("Cost of Meal: "))

This gets the tip_percent which is 15%, 20% and 25% respectively

    for tip_percent in range(15,26,5):

This prints the tip_percent

         print(str(tip_percent)+"%")

This calculates and prints the tip amount rounded to 2 decimal places

         print("Tip Amount: "+str(round(tip_percent * amount/100,2)))

This calculates and prints the total amount rounded to 2 decimal places

         print("Total Amount: "+str(round(amount + (tip_percent * amount/100),2)))

This prompts user to continue or not

    tryagain = input("Continue?y/n: ")

The program ends here

print("Bye!")

You might be interested in
Stamps offers at-home postage and mailing for a monthly fee. Customers are able to carry a balance on their accounts that allows
alexdok [17]

Answer:

The pop-up button is necessary to show acceptance of the terms

Explanation:

5 0
3 years ago
Use the drop-down menus to complete the statements about using column breaks in word 2016
Naily [24]

Answer: Breaks in the word 2016 what do you mean

Explanation:

7 0
3 years ago
Read 2 more answers
Let's play Silly Sentences!
Mrac [35]

Answer:

Grace sat quietly in a stinky stadium with her blue jacket

Grace jumped on a plane to Paris.

Grace ate bananas, apples, and guavas quietly while she listened to the news.

Grace is the name of a major character in my favorite novel

Grace was looking so beautiful as she walked to the podium majestically.

Grace looked on angrily at the blue-faced policeman who blocked her way.

3 0
3 years ago
The area that holds all the instructions the computer needs to start up when it is powered on is ________.
stepan [7]

The area that holds all the instructions the computer needs to start up when it is powered on is b) ROM

Further Explanation:

RAM and ROM are the types of memory. RAM is the active memory. The data can be read and written from RAM. While ROM is read only which meas that data or instructions on ROM cannot be changed.

The files or instructions that are needed to start up a computer are usually unchangeable as they always have to be the same. These type of instructions are stored in ROM. When he computer is turned on, the instructions needed to start the computer are loaded into the main memory from the ROM.

Hence, ROM is the correct answer.

Learn more at:

  • brainly.com/question/10196212
  • brainly.com/question/10250188

#LearnwithBrainly

7 0
4 years ago
_____ is the operation of setting a variable to a value.
Helen [10]

Answer:

Assignment is the operation of a variable to a value

3 0
3 years ago
Other questions:
  • While working on a group project, you notice something does not look right in the presentation. You call a meeting with your tea
    14·2 answers
  • Hello I am currently working on a multi-sim project. In the file I have already created a timer that goes from 00 - 80 and reset
    11·1 answer
  • "2. what are the advantages and disadvantages of using the serial console connection compared to the usb console connection to a
    15·1 answer
  • In most software packages, the function key F1 is used to run the _____program.
    10·1 answer
  • If a client is found _________ the NAP will attempt to make it _______. Group of answer choices A. non-compliant, compliant B. s
    13·2 answers
  • Why is data processing done in computer?​
    14·1 answer
  • Write a method called removeHighPrice that will go through a provided ArrayList called prices and removes the first price that i
    6·1 answer
  • Reply emailing a student who is asking about audio materials​
    6·2 answers
  • Fill in the blanks with the correct words.
    7·1 answer
  • Which access object cannot be used to enter or edit data
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!