/* * File: makechange.cpp * Author: Robert I. Pitts * Last Modified: September 17, 2000 * Topic: Functions * ---------------------------------------------------------------- * * This program determines the number of dollars, quarters, dimes, * nickels, and pennies to give as change. The program expects the * amount of change to make (in cents) as input. * */ #include /************************ Function Prototypes ************************/ // Function: makeChange // Usage: makeChange(cents, dollars, quarters, dimes, nickels, pennies) // In: cents // Out: dollars, quarters, dimes, nickels, pennies // // Determines the amount of each unit to give as change. Assumes // you want to give as many of the larger coins/bills as possible // before giving smaller ones. // ADD THE FUNCTION PROTOTYPE HERE! /*************************** Main Program **************************/ int main() { int cents, dollars, quarters, dimes, nickels, pennies; cout << "How much change to make (in cents): "; cin >> cents; // CALL THE FUNCTION HERE! cout << "\nYour change is:" << endl << dollars << " dollars" << endl << quarters << " quarters" << endl << dimes << " dimes" << endl << nickels << " nickels" << endl << pennies << " pennies" << endl; } /*********************** Function Definitions **********************/ // Function: makeChange // // DESCRIBE HOW YOU IMPLEMENT IT HERE! // ADD THE FUNCTION DEFINITION HERE!