20meansdd
14.07.2020 •
Computers and Technology
Do transformers have life insurance or car insurance? If you chose life insurance, are they even alive?
Solved
Show answers
More tips
- C Computers and Internet How to Delete a Page on VKontakte: The Ultimate Guide from Experts...
- S Style and Beauty 5 Tips for Choosing the Best Ugg Boots...
- H Health and Medicine How to Treat the Flu: A Comprehensive Guide...
- H Health and Medicine Effective Ways to Treat Colic in Infants...
- C Computers and Internet IMHO: What is it, why is it important, and how to use it?...
- F Food and Cooking How to Calculate the Gender of Your Child with Blood?...
- S Style and Beauty How to Get Rid of Under Eye Bruises?...
- C Cities and Countries What time does the Metro open in Moscow?...
- W Work and Career Where can you learn to be a flight attendant?...
- H Health and Medicine What are Electronic Cigarettes? The Ultimate Guide...
Answers on questions: Computers and Technology
- C Computers and Technology Microsoft excel give a visual representation of data that can make the data easier to understand. worksheets workbooks spreadsheets ch21...
- C Computers and Technology Identify the octal literal from the following: a) True b) ‘True’ c) 0o345 d) 0o389...
- C Computers and Technology Describe an idea of a business that you think is an opportunity in your nneighborhood....
- E English What’s the correct answer...
- S Social Studies A behavior, belief, or condition that violates significant social norms in the society or group in which it occurs is termed....
- S Social Studies French, Dutch, and English Colonial Empires Compare and contrast features of French, Dutch, and English colonial empires in southeast Asia by placing the descriptions in the correct...
- C Chemistry Calculate the molarity of 0.5 moles NaHCO3 in 5,314 mL of solution. How do I solve this?...
- P Physics At what point is the speed at a maximum? . A. Just before the skater reaches the very bottom B. At the exact bottom C. A little bit after reaching the bottom...
- P Physics You have two identical-looking metal spheres of the same size and the same mass. One is solid; the other is hollow. If you place them on a ramp, the gravitational torques that make...
- M Mathematics Alberto’s monthly income is $3,200. Part of Alberto’s monthly budget is shown in the table.What percentage of Alberto’s income is used to pay for his rent and groceries?...
Ответ:
The correct order is:
# display a welcome message
print("Bookstore Calculator")
# get input from the user
book_price = float(input("Price of book: "))
tax_percent = float(input("Tax percent: "))
# calculate tip and total amount
tax_amount = round(book_price *(tax_percent / 100), 2)
total = round(book_price + tax_amount, 2)
# display the results
print("Tax amount: ", tax_amount)
print("Total amount:", total)
Explanation:
Given
The above code segment
Required
Place the code in correct order
Using the sample output as a guide:
The first output is a welcome message.
So, the first and second line of the program is:
# display a welcome message
print("Bookstore Calculator")
Next, inputs for book price and tax percent.
So, the next lines are:
# get input from the user
book_price = float(input("Price of book: "))
tax_percent = float(input("Tax percent: "))
Next, outputs for tax amount and total amount.
These outputs must first be calculated.
So, the next lines are:
# calculate tip and total amount
tax_amount = round(book_price *(tax_percent / 100), 2)
total = round(book_price + tax_amount, 2)
Lastly, the results are printed
# display the results
print("Tax amount: ", tax_amount)
print("Total amount:", total)