Chris Pollett>Old Classes>PIC 10a, Spring 2000>Hw3

Spring 2000 PIC 10a HW #3

Due 10:30am May 5

Do problems 2 and 3 on page 210 of your book. Call the program for problem 2, pic10avg.cpp and the program for problem 3, pic10acoin.cpp. Besides illustrating call by reference, this assignment (Problem 3) give you a first exposure to greedy algorithms, a common programming paradigm. For problem 3 you essentially greedily choose as many of the highest value coins in making change until there is not enough change left. Then you move to a lower denomination.

Homework 3 FAQ.

Homework 3 Solution.