Description
Tasks
- P2-32
- P2-35 (Graduate students only. Refer to the program ch02/how_to_1/vending.py in your text book)
- Write a Python program to print the sample receipt shown on the following page:
- Use short item names
- Item prices should be between $100.01 & $999.99
- Calculate and print sales tax amount based on a 7% tax rate
- Total is the sum of subtotal and sales tax
- Assume customers pay cash and an amount higher than the subtotal. Also assume that the customer uses a combination of only $100, $50, and $20 bills
- Calculate and print the amount to be returned to customer
- Use the format specifiers that were used in class programs
What to Turn-In?
In ONE Word document, copy & paste on separate pages
-
Python code
-
The output of programs (screen snip will suffice)
Program Format
- Leave plenty of blank lines in program for readability
- Have plenty of comments
Word Document
-
Homework # and Date at top
-
Text headers as appropriate
-
Single-space, please (especially the code)
-
Click “Remove Space After Paragraph” (see below)
-
Page number bottom-middle
Output Format: Receipt
Amounts align to the right
Receipt Header
SAMPLE RECEIPT
5 ITEMS PURCHASED
______________________________________
Item names align to the left
Labels align to the right
Item 1 |
$ ___.__ |
Item 2 |
$ ___.__ |
Item 3 |
$ ___.__ |
Item 4 |
$ ___.__ |
Item 5 |
$ ___.__ |
Subtotal |
$ ___.__ |
Tax – 7% |
$ ___.__ |
Total |
$ ___.__ |
Customer Paid |
$ ___.__ |
Change to customer, if any |
$ ___.__ |