CIT 591 Assignment 1: Coke Machine
Fall 2009, David Matuszek

Purposes of this assignment:

General idea of the assignment:

Simulate the operation of a Coke machine. This machine offers Coke, Coke Zero, and Caffeine-free Diet Coke. All drinks cost $1.25 (125 cents). The machine takes nickels, dimes, quarters, and dollar bills. When enough money has been entered, a drink may be selected, and any change is returned (the specific coins are listed).

Only "coins" in denominations of 5, 10, 25, and 100 cents are accepted (for our purposes, we can pretend that a dollar bill is a coin). Any other denomination is rejected and returned.

More than one drink may be purchased (that is, the program doesn't quit after selling one drink).

Example:

Here is an example of the use of the program. Program output is brown, user input is green.

Have a Coke! Price: $1.25
Insert coin: 5
Amount entered: 5 cents.
Insert coin: 5
Amount entered: 10 cents.
Insert coin: 10
Amount entered: 20 cents.
Insert coin: 10
Amount entered: 30 cents.
Insert coin: 25
Amount entered: 55 cents.
Insert coin: 25
Amount entered: 80 cents.
Insert coin: 50
** Rejecting 50 cent coin.
Insert coin: 1
** Rejecting 1 cent coin.
Insert coin: 10
Amount entered: 90 cents.
Insert coin: 100
Amount entered: 190 cents.

Please make your selection:
1 - Coke
2 - Coke Zero
3 - Caffeine Free Diet Coke
Your choice: 4
** No such beverage. Choose another.
Your choice: 3
Dispensing Caffeine Free Diet Coke
Returning quarter.
Returning quarter.
Returning dime.
Returning nickel.

Have a Coke! Price: $1.25
Insert coin:

Due date:

Before 6 AM, Friday September 18, 2009, via Blackboard.