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 size font is appropriate for most on-screen presentation slides?
Natali [406]
It's heading 2 or 3, because heading 1 is considerd as too big for slide presentations.
6 0
3 years ago
What technology would you like to use or see developed that would help you be a "citizen of the world"?
Aneli [31]

Answer and explanation:

While traveling abroad the main barrier to be considered is language. Entrepreneurs should focus special attention on developing mobile apps that interpret people's segments accurately so regardless of the country and language they can communicate through the app and make them feel they are "<em>citizens of the world</em>".

3 0
4 years ago
We love him, because he ."
Andre45 [30]
We love him, because he “is everything I need.” I’m kinda confused on the answer lemme know if you need help
7 0
2 years ago
Select
valentinak56 [21]

Answer:

return values.remove() + values.remove();

Explanation:

The appropriate expression to complete the method, which is designed to return the sum of the two smallest values in the parameter array number is indicated below in bold font :

public static int

sumTwoLowestElements(int[] numbers)

{

PriorityQueue values = new PriorityQueue<>();

for (int num: numbers)

{ values.add(num);

}

return values.remove() + values.remove();  

}

The return statementin programming is often used when a function is ready to return a value to its caller.

6 0
3 years ago
6. What is the correct way to write 340,000,000 in scientific notation? (1 point
givi [52]

Answer:3.4X10^8

Explanation:

4 0
3 years ago
Other questions:
  • According to the partnership for 21st-century learning critical thinking ability includes all the following skills except
    15·1 answer
  • What are some examples of options you can control in the Adjust group to affect an image? (Multiple Choice)
    12·2 answers
  • Whats the agenda for annual general meeting ??
    10·1 answer
  • The outstanding disk requests are for tracks 6,10,4,20,36,8, and 40 in that order. Assume that the seek time speed is 5 msec/tra
    14·1 answer
  • Please help ASAP, will mark brainliest!
    14·1 answer
  • What does this mean?
    14·1 answer
  • Who want a rap song if yes try to rap too this Can you move it like this? I can shake it like that
    10·2 answers
  • 1. Write a query in SQL to list the following information of the artists in movie industry. Limit this information to only 5 art
    12·1 answer
  • What is 3x10? PLZZZZZ
    11·1 answer
  • If you click on repeat header rows what will happen?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!