Trish at Bargain Used Books has hired you to write a Python program that will help her
Question:
Trish at Bargain Used Books has hired you to write a Python program that will help her calculate what a customer should pay. She has a very simple price structure:
- Workbooks are $8.50 each.
- Textbooks are $24.00 each.
- Magazines are $5.95 each.
With every purchase, Trish also must charge 6% sales tax on the total.
Create a file named Lab01P4.py. Write a program that calculates the cost for the total purchase:
- Ask the user to enter the number of workbooks, textbooks, and magazines being purchased.
- Calculate the total before tax.
- Calculate the amount of sales tax on the total.
- Calculate the total after tax.
- Output the total before tax, the sales tax, and the total after tax.
NOTE: Your program code should implement these steps IN THE SAME ORDER as listed above.
All monetary values should be output with a precision of 2 digits after the decimal point. You should use what was presented in this lesson to achieve that result, that is, use f-strings. Points will be deducted otherwise.
Sample Output:
Enter the number of workbooks: 7
Enter the number of textbooks: 4
Enter the number of magazines: 6
Cost before tax: $191.20
Sales tax: $11.47
Cost after tax: $202.67
In your program, besides the header comment, add three additional comments:
- A comment that identifies where the input steps begin
- A comment that identifies where the processing steps begin
- A comment that identifies where the output steps begin.
Run this program. Take a screenshot of the Terminal that includes the line showing where you started the program run with the results. Name the screenshot Lab01P4-ouput.jpg.
Accounting Information Systems basic concepts and current issues
ISBN: 978-0078025334
3rd edition
Authors: Robert Hurt