This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: [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, thethe total number of coins returned is the smallest possible....
View
Full
Document
This note was uploaded on 03/26/2010 for the course CS 187154200 taught by Professor Ercegovac,m.d. during the Winter '09 term at UCLA.
 Winter '09
 Ercegovac,M.D.

Click to edit the document details