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
ladessa [460]
3 years ago
8

Ask the user for a total food bill and then find the new total after 6% tax and a tip of the users choice (15, 18, 20%) in pytho

n.
Computers and Technology
1 answer:
chubhunter [2.5K]3 years ago
3 0

Answer:

#here is code in python.

# read the food bill

tot_bill=float(input("Please enter the food bill:"))

# tax on food

tax=0.06

#choice for tip by user

choice=int(input("enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)"))

// calculate the total food bill

if choice==1:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.15)

elif choice==2:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.18)

elif choice==3:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.2)

else:

   print("invalid choice:")

#print the total food bill

print("total food bill is ",tot_food_bill)    

Explanation:

Read the food bill from user and assign it to variable "tot_bill".Initialize the tax=0.06 (i.e. 6%) on the bill.Then ask user to give his choice for tip. if the choice is 1 then tip will be 15%, if 2 then 18% and if choice is 3 Then tip will be 20% of the bill.Calculate the total food bill and assign it to variable "tot_food_bill".

Output:

Please enter the food bill:100                                                                                                                                

enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)2                                                                                            

total food bill is  124.0

You might be interested in
Discuss how 3D modeling enhances animation.
Inessa05 [86]

Answer:

3d modeling enhances animation in many ways.

Explanation:

The first and most obvious way is shadows. When 3d modeling your able to cast more detail shadows then compared to 2d.

7 0
2 years ago
When performing conflict management, it is important to identify your;
Olegator [25]
The goal of the conflict management is to limit the negative effects of a conflict. Some of the strategies used in conflict management are: <span>Accommodating , forcing, compromising, collaborating. When performing conflict management it is important to identify your benefits. Benefits are the positive aspects that arise from the conflict. </span>
6 0
3 years ago
A small network that consists of devices connected by Bluetooth, such as a smartphone and a computer, is referred to as a ______
jeka94

Answer:

I think is technologies

5 0
3 years ago
Data ____ refers to the accuracy of the data in a database
Brilliant_brown [7]
Accuracy or quality?
7 0
2 years ago
What should you do if a headset plugged into your computer is not working properly.
NemiM [27]
Ether get a new headset or take out the plug blow on it or wipe it or clean the inside of the computer where the headset wire goes
7 0
2 years ago
Other questions:
  • Margins can be modified in the page layout or by using__.
    15·1 answer
  • _____ documentation is designed to help programmers and systems analysts understand the application software and maintain it aft
    12·1 answer
  • The essence of strategy is ____, so competitive advantage is often gained when an organization tries a strategy that no one has
    15·1 answer
  • Given the following code segment, what is output after "result = "? int x = 1, y = 1, z = 1; y = y + z; x = x + y; cout &lt;&lt;
    7·1 answer
  • Your organization issues devices to employees. These devices generate one-time passwords every 60 seconds. A server hosted withi
    15·1 answer
  • When examining the digital evidence, what stage deals with using keyword searches and file-carving utilities to locate data that
    5·1 answer
  • How do you change the text style on brainly mobile ?
    12·1 answer
  • Explain what middleware is. Name a common middleware in two-tier client/server architecture for database applications.
    10·1 answer
  • Can someone solve this for me please? It’s part of an escape room.
    13·2 answers
  • Describe the specific job you would want to have if you were going to pursue a career in digital music or video.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!