subject

Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents. For example, if the amount is 86 cents, the output would be something like the following: 86 cents can be given as 3 quarters 1 dime and 1 penny

Use coin denominations of 25 cents (quarters), 10 cents (dimes), and 1 cent (pennies). Do not use nickel and half dollar coins. Your program will use the following function (among others):
void computeCoin(int coinValue, int& number, int& amountLeft);

For example, suppose the value of the variable amountleft is 86. Then, after the following call, the value of number will be 3 and the value of amountLeft will be 11 (because if oyu take three quarters from 86cents, that leaves 11 cents):
computecoins (25, number, amountLeft);

Include a loop that lets the user repeat this computation for new input values until the suer says he or she wants to end the program (Hint: use integer division and the % operator to implement this function.)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
question
Computers and Technology, 24.06.2019 00:40
What social factors affect your health
Answers: 3
You know the right answer?
Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents....
Questions
question
Chemistry, 16.10.2020 20:01
question
Mathematics, 16.10.2020 20:01
question
Mathematics, 16.10.2020 20:01
Questions on the website: 13722367