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 task can a user accomplish by customizing theme colors?
Stolb23 [73]

Answer:

D

Explanation:

I took the test

3 0
3 years ago
Read 2 more answers
What is the meaning of web browser
anastassius [24]
Is that a joke... if ain't cheatin you repeatin
8 0
3 years ago
Na2CO3 → Na2O + what
Katarina [22]

Answer:

CO3

Explanation:

6 0
3 years ago
Read 2 more answers
My HTC Desire 510's mobile data stopped working, how to I make it work again?
denis-greek [22]
Ask your mobile operator
2.go to hrs service
3. Turn on and turn off
4 0
3 years ago
Which of the following are true about the PUSH instruction?
kkurt [141]

Answer:

Option A.

Explanation:

Only option A satisfies the definition of push statements. So it is only the correct option.

7 0
3 years ago
Other questions:
  • ​to prevent intrusions, companies install combinations of hardware and software called _____ to keep unauthorized web users from
    9·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    12·1 answer
  • Can someone help me with this one
    9·2 answers
  • You can find synonyms and disciplinary jargon in the ______, _______, and ______ in your search results. You can then use these
    13·1 answer
  • Computer simulations were first developed during __________<br> as a part of the _____________
    5·1 answer
  • Brainly Question
    14·2 answers
  • How was data put into the Tabulating Machine?
    7·1 answer
  • Cara is cleaning her computer when she notices a loose cable connecting to her printer. Which two ports would the cable most lik
    12·2 answers
  • find_cow(name, cows) Given a name and a Python list of Cow objects, return the Cow object with the specified name. If no such Co
    7·1 answer
  • Chantal has configured the network at her company's new headquarters with a number of VLANs. All devices joined to the individua
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!