Question: THIS IS MY QUESTION, WRITE A CODE IN C++ 12.1 Change Calculator Write a program that calculates number of coins for a given positive cash

THIS IS MY QUESTION, WRITE A CODE IN C++

12.1 Change Calculator

Write a program that calculates number of coins for a given positive cash amount in pennies. So if you input 59, then the output would look like:

59 has 2 quarters, 0 dimes, 1 nickels, 4 pennies

A template has been provided for you

AND THIS IS MY CODE:

#include using namespace std; void computeCoins(int coin_value, int &num, int &amount_left)

{ while(amount_left >= coin_value) { num++; amount_left -= coin_value; } } int main() { int amount_left; int quarters = 0, dimes = 0, nickels = 0; while(true) { printf("Enter number of cents (or zero to quit): "); cin>>amount_left; if(amount_left 99) { cout

WHEN I SUBMIT IT INTO ZYBOOK, I GOT 0 POINT, AND I DONT KNOW WHERE IS THE PROBLEM.

PLEASE HELP ME FIX IT.

THANK YOU!!

THIS IS MY QUESTION, WRITE A CODE IN C++ 12.1 Change Calculator

Only show failing tests Download this submission 1: Compare outputA 0/5 Program generated too much output. Output rostricted to 50000 characters. Check program for any unterminated loops generating output. Input 59 Enter number of cents (or zero to quit): 59 cents can be given as 2 quar Enter number of cents (or zero to quit): 4 cents can be given as 4 penni Enter number of cents (or zero to quit): 4 cents can be given as 4 penni Enter number of cents (or zero to quit): 4 cent.s can be given as 4 penni Entor number of cents for zero to quit): 4 cents can be given as 4 penni ntor number of cents (or zero to quit): 4 cents can be given as 4 ponni Enter number of cents (or zero to quit): 4 cents can be given as 4 penn Enter number of cents (or zero to quit): 4 cents can be given as 4 penn Enter number of cents (or zero to quit): 4 cents can be given as 4 penni Enter number of cents (or zero to quit): 4 cents can be given as 4 penni Enter number of cents (or zero to quit): 4 cents can be given as 4 penni Enter number of cents (or zero to quit): 4 cents can be given as 4 penni Enter number of cents (or zero to quit): 4 cents can be given as 1 penni Enter number of cents (or zero to quit): 4 cents can be given as 1 pen nter number of cents (or zero to quit): 4 cents can be given as 1 penn Enter number of cents (or zero to quit): 4 cents can be given as 1 penn Enter number of cents (or zero to quit): 4 cents can be given as 1 penn Enter number of cents (or zero to quit): 4 cents can be given as 1 penni Enter number of cents (or zero to quit): 4 cents can be given as 4 penni Enter number of cents (or zero to quit): 4 cents can be given as 4 penn Enter number of cents (or zero to quit): 4 cents can be given as 4 penni

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!