Frequently Asked Questions (FAQ) for Project 1

1) Is the input file supplied by you?

Your program will be tested using a randomly generated input file. However, you can always assume that the input data is valid as per the specifications.

2) How should "the machine" deal with this situation:

... there are absolutely no change left in the machine and some one buy a $0.50 item and paying with a dollar bill, a dime, and a nickel ... how should the change of $0.65 be handled? Should the machine return as much as it can but less than the change amount (would be $.15 in this case) ... should the machine return the least amount over the change (Would be $1 in this case)????

Read the assumptions again.

The machine will never run out of change. There will be enough change at the beginning of the day to handle all the transactions for that day. This is a simplifying assumption to make your coding less complicated. The generated input file will always honor this assumption.

3) I know there is EOF for end of file but is there a way to read end of line?

There are ways to check for end of line. However, you don't have to do that for this project. There is a simpler solution for what you are trying to do. Try to answer the following question -At what point is the machine going to deliver the item purchased? Think about it.

4) My question regarding the first project on the vending machine problem is whether we are assuming that the customer will always have enough money when making a purchase, or will the program have to check for valid input. I.E. the customer only gives in 25 cents for a 50 cent item.

The customer will always have enough change to effect the purchase. The generated input file by which your program is tested will always honor this assumption.