Answer:
The correct order is:
<em># display a welcome message</em>
<em>print("Bookstore Calculator")</em>
<em># get input from the user</em>
<em>book_price = float(input("Price of book: "))</em>
<em>tax_percent = float(input("Tax percent: "))</em>
<em># calculate tip and total amount</em>
<em>tax_amount = round(book_price *(tax_percent / 100), 2)</em>
<em>total = round(book_price + tax_amount, 2)</em>
<em># display the results</em>
<em>print("Tax amount: ", tax_amount)</em>
<em>print("Total amount:", total)</em>
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:
<em># display a welcome message</em>
<em>print("Bookstore Calculator")</em>
<em />
Next, inputs for book price and tax percent.
So, the next lines are:
<em># get input from the user</em>
<em>book_price = float(input("Price of book: "))</em>
<em>tax_percent = float(input("Tax percent: "))</em>
<em />
Next, outputs for tax amount and total amount.
These outputs must first be calculated.
So, the next lines are:
<em># calculate tip and total amount</em>
<em>tax_amount = round(book_price *(tax_percent / 100), 2)</em>
<em>total = round(book_price + tax_amount, 2)</em>
<em />
Lastly, the results are printed
<em># display the results</em>
<em>print("Tax amount: ", tax_amount)</em>
<em>print("Total amount:", total)</em>