CS1440 - Extra Lab (2)

Objectives:
Objective of this extra Lab is:
To review the concepts you learned in Chapters 1-5

Preparations:
You need to create the directory extra2 under directory 1440, change to that directory, and complete your work there.

Activity (1):
Suppose you want to write a program to help a cashier figure out the change that is due to a customer.  There are several different ways the cashier can make the change using different coins or bills.  I know everyone is trying to avoid pennies, so letís assume, up front, that change with all pennies is not allowed unless the amount of change is less than 5 cents.  Letís also assume, for now, that the total amount of change is not more than $5, i.e., the cashier works only with change amount of less than $5.  Your program should only recommend one possible configuration.

We'll presume that the cashier can use pennies, nickels, dimes, quarters, and dollars.  I think that if you ask, any cashier will tell you that you should start from larger denominations (coins or bills) and work toward smaller denominations when you make the change.

You are expected to use function(s) in your program.  Your program will be graded based on correctness of computations, appropriate use of function(s), the creativity that you have shown in creating a good program, and programming style. If you haven't re-read the style guidelines recently, maybe you should look at the CS 1440 Program Style Guidelines.

Input:
The amount of change, which will be read from an input file.
Example:  2.32 (Note this means $2.32)

Output:
The configuration of the change due to the customer which will be written to an output file:

Example of one possible output for the $2.32 is:
2 dollar bills, 1 quarters, 0 dimes, 1 nickels, 2 pennies

Bonus:
You may do either (or both) of the following for extra credit.

  1. [10 points] Output "cleanup". With these changes the sample output above would read:
    2 dollar bills, 1 quarter, 1 nickel, 2 pennies
  2. [30 points] Use data files as described below
    Your program will ask the user to provide the name of a data file and the name of an output file. The data file contains one number per line -- each number in the file is an amount of change to be given. Your program reads all the numbers in the input file and for each of them reports how the change will be given. All output during the "change-making" phase of the program goes to the specified output file.

Post Lab
This extra lab does not have a post lab, however your instructor will give you an assignment that should be completed by the dealine that will be given with the assignment.