# lab03 - The coins you should get back are 3 quarter(s 1...

This preview shows page 1. Sign up to view the full content.

Lab 3: Making Change Last Modified 12/17/2008 Key Concept: integer arithmetic, assignment operator Write a program that takes in an amount of change on a purchase (in cents) and breaks it down into the optimal number of quarters, dimes, nickels, and pennies. For example, if you were to get 92 cents change, the best way to do that would be three quarters (75 cents), one dime (10 cents), one nickel (5 cents), and two pennies (2 cents). You must use the integer division and modulus features of C++ in this lab. You must also use the assignment operator to set the values of your variables before you output them. (These are the focus areas of the lab.) Begin by doing analysis and design of this problem. Sample Interaction Enter an amount of change in cents: 92
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The coins you should get back are: 3 quarter(s) 1 dime(s) 1 nickel(s) 2 pennies Report Requirements Use the lab report template for the following: • Code • Sample Runs - at least 3 of them; the data for the first two should match your analysis • Discussion - the usual Print out your lab report. When you turn in your lab report, have one of us verify that you've completed the analysis & design worksheet and sign off on that. We will not collect this sheet, but you must have completed it to receive full credit for the lab. With this lab and all future labs, submit your source code ( .cpp file ONLY) to the Lab 3 dropbox on ANGEL. The dropbox is found under the Lessons tab....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online