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
The CSS property of top , bottom , left , or right moves the element the specified distance from the respective edge of the clos
borishaifa [10]

Answer:

Relative

Explanation:

Web development is a process of designing and building a web page or website. HTML, CSS and JavaScript are the basic tools used in building a website.

Cascading style sheet or CSS is a web development tool used to style the content of a HTML file. Css has pointers used to represent HTML elements for styling. A HTML element can be fixed, absolute or relative.

When a CSS file sets an element relative to it container or other element, the element can be moved to the right, left, top or bottom position relative to the four corners of the parent element.

7 0
3 years ago
What is the best operating system
True [87]
#1 Windows
#2 Ubuntu
#3 Mac OS
#4 Fedora
#5 Solaris

Those are the top 5 best operating systems
6 0
3 years ago
Discuss how sentiment analysis works using big data?<br>​
Fantom [35]
<h3>Answer:</h3>

sentiment analysis is the process of using text analytics to mine various of data for opinions. often sentiment analysis is done on the data that is collected from the internet & from various social media platforms.

5 0
3 years ago
Both employers and employees have responsibilities and ___________.
Alex787 [66]

I would guess that the answer is Rights.

4 0
3 years ago
Read 2 more answers
Craig's annual take-home pay is $75,000. What is the maximum amount that he can spend per month paying off credit cards and loan
kipiarov [429]

$ 75000 is the maximum amount that he can spend per month paying off credit cards and loans and not be in danger of credit overload.

More than this amount will exceed his income.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Consider the following sequence of items 10, 36, 25, 54, 37, 12, 75, 68, 42, 86, 72, 90. Insert these items in the order above,
    5·1 answer
  • What is the most consistent item regardless of the software used in BI?
    5·1 answer
  • An example of software most commonly associated with productivity software is ____.
    12·1 answer
  • What does TIA stand for?
    7·2 answers
  • The algorithm credited to Euclid for easily finding the greatest common divisor of two integers has broad significance in crypto
    11·1 answer
  • In ____, two or more disk drives become one large volume, so the computer views the disks as a single disk.
    13·1 answer
  • An organization is developing an authentication service for use at the entry and exit ports of country borders. The service will
    10·1 answer
  • Explain the different features available in Print command?
    10·1 answer
  • Laura is filming a scene in which the subject is sitting with a lit fireplace behind him. The only other source of light in the
    15·1 answer
  • What goes in between the &lt; &gt; when declaring a new ArrayList?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!