Assignment 1
CpSc 101
Cash Register Program
Requirements: The requirement is for a program that requests from the user the text description, price and number of units to be purchased for each of three items. The program will calculate the total cost of each type of item and the sales tax on the total for the items. The program prints a bill that includes the description of the item, number being purchased, its unit and total costs, the amount of sales tax for the entire purchase and the final total. The program should charge 5% sales tax. The program should then ask for the amount to be tendered in payment and calculate and print the amount of change required to be returned to the customer.
Output of the bill should look like:
|
Diet Coke |
3 |
1.59 |
5.77 |
|
Chips |
2 |
2.50 |
5.00 |
|
Cookies |
6 |
1.75 |
10.50 |
|
Sales Tax |
|
|
1.06 |
|
Total |
|
|
22.33 |
Input uses the InputBox class from the javabook package and the Output uses the OutputBox class.
Submission Package:
Submit three items: An object diagram, a design document and the Java source code.
The submission process will be very simple. First, call the class that you create CashRegister. Place the *.java file (containing the Java source code) in the CLE course folder.
Due: in your CLE course folder no later than midnight on September 13th.
Materials: