Tom Kelliher, CS17
Feb. 23, 1996
Some diskettes will be provided which contain the following program. The program name is broken.cpp. Load the program, then do a ``Save as'' to save it onto you N: drive. Then, pass the diskette along to the next person.
Using this program:
void main() { int change; int quarters; int dimes; int nickels; int pennies cout << "Enter amount of change to be returned: "; cin >> Change; quarters = 0; while (change >= 25) { quarters = quarters + 1; change = change - 25; } dimes = 0; while (change >= 10) { dimes = dimes + 1; change = change - 25; } nickels = 0; while (change >= 5) { nickels = pennies + 1; change = change - 5; } pennies = change; cou << "Quarters: " << quarters << endl; cout << "Dimes: " << dimes << endl; cout << "Nickels: " << nickels << endl; cout << "Pennies: " << pennies << endl; return 0; }