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
sergij07 [2.7K]
3 years ago
6

Problem 1 Calculating the tip when you go to a restaurant is not difficult, but your restaurant wants to suggest a tip according

to the service diners receive. Write a program that calculates a tip according to the diner’s satisfaction as follows: •Ask for bill amount •Ask for the diners’ satisfaction level using these ratings: 1 = Totally satisfied, 2 = Satisfied, 3 = Dissatisfied. •If the diner is totally satisfied, calculate a 20 percent tip. •If the diner is satisfied, calculate a 15 percent tip. •If the diner is dissatisfied, calculate a 10 percent tip. •Report the satisfaction level and tip in dollars and cents Format tips to 2 decimal points; if the bill is 105$ and satisfaction level is 3, then the tip will be $10.50
Computers and Technology
1 answer:
DIA [1.3K]3 years ago
4 0

Answer:

bill = float(input("Enter the bill amount: "))

rating = int(input("Choose a rating: 1 = Totally satisfied, 2 = Satisfied, 3 = Dissatisfied.: "))

if rating is 1:

   tip = bill * 0.2

elif rating is 2:

   tip = bill * 0.15

elif rating is 3:

   tip = bill * 0.1

print("The rating is: " + str(rating))

print("The tip is: $%.2f" % (tip))

Explanation:

*The code is in Python

- Ask the user for the <em>bill</em> and <em>rating</em>

- Depending on the <em>rating</em>, calculate the <em>tip</em> using <u>if else</u> statement i.e. If the rating is chosen as 1, calculate the tip by taking 20 percent of the bill.

- Print the <em>rating</em> and the <em>tip</em>

You might be interested in
What is the multiplier effect, and how can you prevent if from happening?
nadezda [96]

Answer:

 The multiplier effect is the economical process that basically increase the final and national income disproportionately which results in the greater consumption as compared to the amount of the initial spend.

 In other words we can define as the capital implantation, regardless of whether it is in the legislative or corporate level, ought to have snowball impact in the monetary action.

It can be prevent by many ways by increasing the reserve ratio in the economical sector and by also increasing the taxes.

7 0
3 years ago
Brainstorm what you want your LED board to do. What would need to happen first? What happens next?
lbvjy [14]
First it will glow then change what color you want
5 0
3 years ago
Read 2 more answers
Tristan has moved the Television and related equipment
madreJ [45]

Answer:

1: C

2: B

3: A

Explanation:

6 0
3 years ago
20 POINTS!!!
Rina8888 [55]

Answer:

the third one

hope this helps

5 0
3 years ago
What is the first thing you need to do to edit a graph?
Kay [80]
Know the numbers and info
3 0
2 years ago
Read 2 more answers
Other questions:
  • A _____ is a link on a web page that leads to another web page.
    13·1 answer
  • What is the preferred procedure for putting customers on hold​
    13·2 answers
  • 2. (8 points) When creating the Academic Database, there were several instances of data
    11·1 answer
  • Windows stores information from the Credential Manager application in secure folders called
    5·1 answer
  • On his website, Mario has a video that visitors must click to play. He wants the video to play automatically when the page loads
    9·1 answer
  • Which of the following transfer rates is the FASTEST?
    15·1 answer
  • Which types of scenarios would the NETWORKDAYS function help calculate? Check all that apply.
    15·1 answer
  • how does a demilitarized zone (dmz) work. A.By preventing a private network from sending malicious traffic to external networks
    10·1 answer
  • What is Data rate?<br> What is BAUD RATE?<br> What is bandwidth?
    8·1 answer
  • How many pages is 1500 words double spaced 12 font?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!