Project 3

Kevin Nilson

http://www.smccd.net/accounts/nilsonk/

Abstract

CS 381 Project 3, Java Programming I, Fall 06


1. Assignment

Due - September 18

Write a simple Java program that performs like a cash register.

  • Your Java Classes should use the package edu.smccd.cis381.fall2006.project3

  • Your program must be compatible with project3-build.xml

I expect 3 classes for this assignment

  • CashRegister

  • Money

  • CashRegisterTester

Please review "How to Turn in Assignments" for information about how to submit and other requirements.

2. Description of Classes

Figure 1. UML

UML

Class Diagram for CashRegister and Money

3. CashRegisterTester

CashRegisterTester should do the following

  1. Create one or more CashRegisters.

  2. Make some purchases.

  3. Print the change after each purchase.

  4. Print the balance of the cash register before exiting.

4. CashRegister

  • return null Change if not sufficient funds given to make purchase

  • May make change at any time.

  • No refunds are given, only purchases may be made.

  • The register only keeps track of the total balance, it does not have any idea what bills and coins it has inside.

5. Money

  • Don't forget 5 singles is equal to a five dollar bill.

  • When giving change please use as much of the highest value currency as possible. When giving change $27.33 give: 1 twenty, 1 five, 2 singles, 1 quarter, 1 nickle, and 3 pennies.

  • When customers pay they may use any distribution of currency they wish.