CSCI 160 Programming Exercise 1, Fall 2005 DUE: The programming exercise is due on or before 3am, Wed Oct 19. This programming exercise is worth 20 objective points. Your solution will be graded on the basis of its run-time behaviour and on the clarity and simplicity of the source code. See the marking guide in ~csci160/Pex1/markingGuide. With regard to simplicity and clarity, follow the ASAP principle: as simple as possible. INSTRUCTIONS: Issue the command: cp -r ~pwalsh/Pex1 . to copy the programming exercise work directory to your account. Locate to Pex1 (enter the command cd Pex1) and use the CSCI 160 Exercise Development Utility to test, verify and submit your programming exercise. This programming exercise is to be completed by each student. Submit your solution by typing make submit in the Pex1 directory. Your programming exercise must be received before the due date and time. All other methods of submission will not be accepted. You will receive no credit for a programming exercise submission that fails to adhere to this convention. QUESTION: Description =========== Write a C++ program that manages a customer's purchase and payment. Your program must - read a product code and a quantity - determine the cost of the purchase - add 7% tax - read the amount the customer has submitted as payment - determine the change (if any) the customer must receive - return the change in loonies, quarters, dimes, nickels and pennies (you must minimize the total number of coins returned) The unit cost associated with each product code is a=$0.50 b=$0.75 c=$0.86 d=$1.05. Sample Output ============= You can execute a prototype implementation of my solution to examine correct behaviour (./proto). Enter product code [a..d] a Enter product quantity [1..9] 2 Total cost of purchase is $1.07 Enter payment in dollars [0..99] 2 Enter payment in cents [0..99] 0 Your change amount is $0.93 Coins returned: Loonie(s) 0 Quarter(s) 3 Dime(s) 1 Nickel(s) 1 Pennies 3 Assumptions/Restrictions ======================== All numeric data is to be read, stored and manipulated as integers (you must NOT have any floating point variables). Assume that all data read is of the correct type and within range (see sample output). Test Set ======== see Pex1/tinp