{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw6 - [CSM51A W09 Assignment 6 Assigned Due TAs Pouya...

This preview shows pages 1–2. Sign up to view the full content.

[CSM51A W09] Assignment 6 Assigned: 02/16/09, Due: 02/23/09 TAs: Pouya Dormiani ([email protected]), Gabriel Pan ([email protected]) Rules of Engagement: Exercises are for your practice–solutions are provided so you can check your work. Homework problems must be submitted on the specified due date before lecture starts. Once lecture starts, a homework is considered late and will not be accepted. Please write legibly and follow directions. Exercises From the book: 8.1, 8.2, 8.3 Homework Problems (45 points total) Problem 1 (15 points) Our goal is to design a vending machine which sells stamps. The price of a stamp is 35 cents (for the sake of the problem). The machine accepts only nickels (5 cents), dimes (10 cents), and quarters (25 cents). When the total value of coins is equal to or larger than the price of the stamp, the machine deploys the stamp, and returns any change as necessary. The change is given in nickels or dimes, and is returned in a way such that the total number of coins returned is the smallest possible. For example, if the amount of change is 30 cents, the

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}