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
What are the ASE special certifications?
kykrilka [37]

Answer:

It is The National Institute for Automotive Service Excellence.

Explanation:

8 0
3 years ago
Read 2 more answers
Americans overwhelmingly support organ and tissue donation.
Simora [160]

This statement would be TRUE


7 0
3 years ago
Steps needed to deposit cash on cash deposit machine
Artyom0805 [142]
Honestly, just google this please... but because I'm eating a cookie here you go...
<span>Deposit in your own account using your debit card:</span><span>Insert debit card and enter PIN for validation.Select account type (Saving or Current).<span>Place the money in the cash deposit slot and click “Continue”.</span><span>Machine will sort the cash and will show denomination-wise amount to be deposited.</span><span>If correct, click “Deposit”.
or this website
http://www.uandblog.com/How-To-Deposit-Money-In-A-Cash-Deposit-Machine

</span></span>
7 0
3 years ago
The ____ function displays the highest value in a range.
Monica [59]
Max()

------------------------------------------------------------
5 0
3 years ago
Read 2 more answers
What are the three main components of a for loop?
insens350 [35]

Answer:

Similar to a While loop, a For loop consists of three parts: the keyword For that starts the loop, the condition being tested, and the EndFor keyword that terminates the loop.

Explanation:

Loop statements usually have four components: initialization (usually of a loop control variable), continuation test on whether to do another iteration, an update step, and a loop body.

8 0
3 years ago
Other questions:
  • Web pages with personal or biograpic information are called ​
    10·1 answer
  • Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending whe
    12·1 answer
  • When you use the bufferedreader class, you must import the ____ package into your program?
    14·1 answer
  • Compute the bitwise XOR between 10010100 and 11101010.
    12·1 answer
  • A musical compact disc is an example of
    13·1 answer
  • Which party controlled the White House and politics in the late 1800s, except for Grover
    6·2 answers
  • _________ is the start up sequence a computer conducts.
    9·1 answer
  • Drag each tile to the correct box.
    9·1 answer
  • Double clicking the top right corner of a document will
    12·1 answer
  • • Use variable to create the number 0 at location 0, 400.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!