//-------------------------------------------------------------------- // change.cpp calculates the coins returned from a vending machine // as change from a purchase. // Input: Actual cost of items in cents. + // Amount of money put into the machine // Output : Total change returned // Number of quarters, dimes, adn nickels returned // Programmer: Mark Cruz // AP IB Computer Science // 9/30/2002 // 2B //-------------------------------------------------------------------- #include #include int main() { cout << "Enter the cost of the item in cents :"; int cost; cin >> cost; cout << "Enter the amount of money you put into the machine in cents :"; int in; cin >> in; int change = in-cost; int quarters = change/25; int dimes = quarters%10; int nickles = dimes%5; int pennies = nickles; cout << "You should have recieved " << change << " cents in change. \n " ; cout << "That amounts to: \n " <