// --------------------------------------------------------------------------- // MoneyChange.cpp // // Written By: YourNameGoesHere // Last Modified: DueDateGoesHere // // Description: // Breaks down input cent amount into appropriate change // Largest coin is 1 dollar, followed by quarters, dimes, nickels, pennies // No bills and no fifty cent pieces allowed // Breakdown uses the max amount of largest currency first // So 2345 cents cannot be represented as 2345 pennies // --------------------------------------------------------------------------- // include iostream to be able to use std::cin and std::cout // make use of the appropriate namespace for cin and cout int main() { // Pick good variable names, // comments here are for helping you, // and not really for documenting the program // TODO: Declare the Variables Needed (all are integers) // Total cents entered by the user // dollars // quarters // dimes // nickels // pennies; // Get the total cents from the user cout << "Enter total cents: "; // TODO: There is a line mising here // Compute the number of each coin needed // There are several ways to do this // Computing the amount using integer division // and then subtracting it from cents repeatedly should work // Might also be able to use modulus i.e. a % b // TODO: there are lots of lines missing here pennies = cents; // Pennies should be all that is left // Display the amounts cout << "This corresponds to "; // TODO add the needed couts here // return 0 to indicate success to the operating system }