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
A network technician cannot get a host to connect to the internet. running the ping command shows the apipa ip address. what is
Lunna [17]
The router will not connect to th network. This will keep it from connecting to the NEXUS
6 0
3 years ago
What are some options available in the Spelling and Grammar Checker in word?
denpristay [2]
Some options are add to dictionary, ignore once, ignore all, autocorrect, change, and change all.
6 0
3 years ago
____ 59. Suppose that x and y are int variables, ch is a char variable, and the input is: 4 2 A 12 Choose the values of x, y, an
Vlada [557]

Answer:

d. This statement results in input failure.

Explanation:

We are taking input of 3 variables only and those are x,ch,and y. cin is a C++ keyword used take input entered by the user onto the screen cin is not a variable.

The input should of type int char int as written in the code. First is x and character variable ch and then the integer variable y and there should be only three inputs.

8 0
3 years ago
Read 2 more answers
The tcp/ip ____ layer commonly uses the transmission control protocol (tcp) to maintain an error-free end-to-end connection.
aleksklad [387]
The answer would be the TCP/IP Application Layer.
6 0
3 years ago
The dns clients that make requests to the dns server are known as ____________.
beks73 [17]
<span>The dns clients that make requests to the dns server are known as : </span>Recursive queries

-Hope this helps.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Typically, a dvd has how many times more capacity than a cd?
    5·1 answer
  • Which one of these variables has an illegal name?
    11·1 answer
  • Predict how digital video will be viewed in the future. Step into the year 2028. How are people viewing digital video? Or have w
    13·2 answers
  • A recommended cleaner for the bowls of coffee brewers is
    7·1 answer
  • Hi there! I just started my beginner computer science class and I was wondering if anyone wants to help with an assignment i'm h
    15·1 answer
  • HELP
    11·1 answer
  • Group of programs are software <br>​
    11·1 answer
  • What are 3 of the most important things about internet safety that you would recommend and why
    15·1 answer
  • Flash drive / USB is ___________ device. A)Input B)Output C)Internal D)None of these
    5·1 answer
  • Consider a game that is searched using random restart hill climbing strategy. Assume that the success rate for the game is 25%.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!