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 is Patch tool ???<br><br>​
AfilCa [17]

Answer:

<u><em>DEAR HERE IS YOUR ANSWER:</em></u>

<u><em>T</em></u>he Patch Tool is part of the healing brush set of tools. These are the go-to tools for retouching and repairing your images. The Patch Tool is primarily used to repair larger areas of an image, or get rid of any distractions or blemishes.

  • The patch tool was introduced into Photoshop at the same time as the Healing Brush
  • You don’t have to use the Patch tool to define a selection. You can use any selection tool and then select the Patch tool.  <em><u> </u></em>

<em><u>HOW TO USE PATCH TOOL IN PHOTOSHOP:</u></em>

  1. Click and hold the Healing Brush tool to select the Patch tool; on the Options bar, select the Destination radio button
  2. With the Patch tool still selected, drag to create a marquee around the source you want to use as the patch
  3. After you create the marquee, drag the selected source area to the destination to be repaired.

<em><u>I HOPE IT WILL WORK DEAR THANKS FOR ASKING  QUESTION</u></em>

Explanation:

4 0
3 years ago
Read 2 more answers
Assume that we would like to expand the MIPS register file to 128 and keep the size of all other fields as in the original MPIS
garri49 [273]

Answer:

These changes has the ability to decrease the size of a program, it

can do so by going ahead to reduce the instances in which the register contents “spill” into other registers or memory, it also does so by allowing more complex operations to be implemented in one instruction as agianst requiring multiple instructions.

On the other hand they are likely able to increase the size of a program by requiring adding bits to the opcode and register fields, thereby increasing memory width

Explanation:

See answer

7 0
3 years ago
Read 2 more answers
Which keys should you press to insert a comment? Ctrl+Alt+I Ctrl+Alt+C Ctrl+Alt+O Ctrl+Alt+N Ctrl+Alt+M
MatroZZZ [7]

In OpenOffice Writer, you can insert comments with the Comment option under the Insert tab. Alternatively, you can use the Ctrl+Alt+N keys.

4 0
3 years ago
Your school has been declared a school of technology
Angelina_Jolie [31]
I don't really understand the meaning of the question. Can you reply and i'll try to help...
7 0
3 years ago
Describe how electrons move between atoms to create electricity.
pentagon [3]
Applying potential difference to a conductor, by potential force, free electrons gain energy and move from low to high potential. Thus, electrons move from one atom to another.
3 0
3 years ago
Read 2 more answers
Other questions:
  • Aubrey didnt like to use graphics or images on her slides. She preferred to use only a title for her slides and bullet-poinged t
    14·2 answers
  • 13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
    15·1 answer
  • A port is the point at which a peripheral device attaches to or communicates with a computer or mobile device. True False
    15·1 answer
  • PLEASE HELP <br> Which of the following best describes the existence of undecidable problems?
    7·1 answer
  • How can your network be infected with malware or ransomware?
    6·1 answer
  • The identification of the technology management framework contain?
    6·1 answer
  • Update thejavafile names to include your initials at the end, send .java file only.1. Completein-place heapSort, which takes an
    11·1 answer
  • Genres are useful for many reaseons. What are some explanations you can think of for how genres can be useful to players, game d
    5·1 answer
  • 7 TH GRADE QUESTION...PLS HELP
    12·2 answers
  • What are the steps to view two different versions of the same document at once?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!