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
You have four DCs in your domain. Active Directory appears to be corrupted on one of the DCs, and you suspect a failing hard dri
Softa [21]

Answer:C

Explanation:

5 0
3 years ago
Select the correct answer. Larry finds it easy to run legacy programs and applications in a virtualized environment. How does th
muminat

The answer is B: installs and runs different versions of an operating system on the same computing device

Virtual machines are like guest operating systems or application environments that give you the perception that you are physically connected to a different box. A system virtual machine, for instance, copies all the components and processes of a real computer. It helps the user experiment with different operating systems and applications without the need to install them on your physical hardware.


8 0
3 years ago
What are the 3 rules of music<br><br> ps: there is no music subject so i had to put something else
Kitty [74]

Answer:

Rules that apply to all situations and accasions in the music room

Explanation:

I hope this helps

7 0
3 years ago
Read 2 more answers
Consider the following code: def tryIt(b): for i in range(len(b)): b[i] = b[i] + 100 #***********MAIN************ x = [] x = [56
WINSTONCH [101]

Answer: I took a high school robotics class when I was in 5th grade and I don't even understand your code there aren't any instructions other than <em>"</em><em><u>Consider</u></em><u>"</u> the following code you may want to improve your question

7 0
3 years ago
Why are open standards important in the data communications industry?
IrinaK [193]

They enable interoperability between software and hardware from different vendors.

5 0
3 years ago
Other questions:
  • You would like to set up an online meeting to communicate with colleagues on a group project. Which of these tools should you su
    9·1 answer
  • Which of the following functions and expressions will convert the ASCII character "Z" to its numeric equivalent ASCII code?
    7·1 answer
  • Discuss three ways you could (or currently do) use the Excel software in your personal or professional life. Provide examples an
    12·1 answer
  • . Constructors can / cannot (circle correct choice) be called explicitly as if they were regular member functions.
    10·1 answer
  • If a small monster collector:- Has 16 small monster containment devices and intends to use all of them.
    10·1 answer
  • 17. When an industrial electrical circuit requires a 220 VAC single phase power supply, the electric power supply circuit is nor
    7·1 answer
  • What games do you play?<br><br><br> Be sure not to report any answers!
    5·1 answer
  • What is the scope of numC?
    8·2 answers
  • Which element of the MakeCode Arcade interface represents an individual
    12·1 answer
  • For quantitative data (e.g. the number of milligrams of a drug) coding your data involves?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!