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]
2 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]2 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
I need help 40 points and brainless
marta [7]

Answer:

the answer is 50

Explanation:

hope that helped

3 0
3 years ago
Consider the following code: <br> x=9 y = -2 z=2<br> print (x + y * z)<br> What is output?
Goryan [66]

Answer:

14

Explanation: The reason why is because adding a negative is pretty much subtracting by 2. 9-2=7. Then multiply 7 by 2 like add 7 to 7 and you get 14.

3 0
3 years ago
Write a program that will allow a grocery store to keep track of the total number of bottles collected for a seven-day period. T
Anna35 [415]

Answer:

  • Print the values days of bottles.
  • Display total number of bottles collecting.
  • Display the payout for this transaction.

Explanation:

Program:-

DEPOSIT_PER_BOTTLE = 0.10

another = "Y"

while another=="Y":

   print("Input Values 7 days of bottles:")

   total = 0

   for I in range(7):

       collected_bottles = int(input())

       total += collected_bottles

   payout = total*DEPOSIT_PER_BOTTLE

   print("Total number of bottles collected: {:,}".format(total))

   print("Payout for this transaction $%.2f"%payout)

   another = input("Do you want to complete another transaction? ").upper()

7 0
2 years ago
For activities with output like below, your output's whitespace (newlines or spaces) must match exactly. See this note. Jump to
Vinvika [58]

Answer:

The program to this question can be given as:

Program:

#include<stdio.h>//include header file

int main() //defining main method

{

printf("Hello..! and please vote the answer."); //print value.

return 0;

}

Output:

Hello..! and please vote the answer.

Explanation:

In the given question some information is missing that is the message to be printed, In this code assume some message to be displayed, and the description to the above code as follows:

  • In the above code firstly header file is included for using a basic function like print method, input method, etc.
  • In the next line main method is defined, inside the main method a print function is used in this function a message is passed with a double-quote ("'). When the code will execute it will print the message that is given in the output section.

5 0
2 years ago
Networking Gadgets, Inc. currently employs 8 people but plans to hire 10 more in the next four months. Users will work on multip
kirza4 [7]

Answer:

Following is given the solution to the question.

I hope it will make the idea clear.

Explanation:

7 0
3 years ago
Other questions:
  • Charles sends Julia text messages every morning insulting her appearance and threatening to hurt her. He writes unflattering des
    5·2 answers
  • What are 3 characteristics of syndrome E?
    13·1 answer
  • In a relational database, the three basic operations used to develop useful sets of data are:
    10·1 answer
  • If you were going to construct a table that only included shape names with number prefixes, which shape would you include
    11·1 answer
  • Using C++
    15·1 answer
  • Part 2: a) Write VHDL code for a top module that invokes necessary components to display the four decimal digits on four seven-s
    5·1 answer
  • State and give reason, if the following variables are valid/invalid:
    12·1 answer
  • What are other ways you could use the shake or compass code blocks in physical computing projects?
    15·2 answers
  • What are the two main parts to a VR experience.
    12·1 answer
  • Which code snippet is the correct way to rewrite this in Semantic HTML?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!