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 quarter(s), 1 dime(s), and 1 penny (pennies)

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 (possibly among others):

Void computeCoin( int coinValue, int& number, int& amountLeft );

// Precondition: 0
// Postcondition: number has been set equal to the maximum

// number of coings of denomination coinValue cents that

// can be obtained from amountLeft cents. amountLeft has

// been decreased by the value of the coins, that is,

// decreased by number*coinValue.

For example, suppose the value of the variable amountLeftis 86. Then, after the

following call, the value of numberwill be 3 and the value of amountLeftwill be 11

(because if you take three quarters from 86 cents, that leaves 11 cents):

computeCoins(25, number, amountLeft);

Testing your program:

Be sure to test your program with various values to ensure it provides the correct

output before submitting to get full credit. For extra credit, have your program only

accept proper input values (1 to 99). If the user attempts to enter an invalid

number, your program should output an error message and repeat the input

process until it receives an appropriate value. (Hint: use a while or do-while loop.)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Kyle wants to access his school’s home page. how can he do this?
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Aman travel 200m towards east< br /> from his house then takes left< br /> to turn and moves 200 m north< br /> find the displacement & distance.< br />
Answers: 3
question
Computers and Technology, 25.06.2019 06:00
Write a method public static string getdigits(string phonenumber) that takes an 11-character phone number written with any combination of 11 uppercase letters, lowercase letters and/or digits, and zero or more hyphens, and which returns the digits that a person would have to press on a cell phone to dial that phone number. we will use the mapping of letters to digits given at en.wikipedia.org/wiki/telephone_keypad# /media/file: telephone-keypad2.svg you may assume that the string parameter phonenumber contains some combination of exactly 11 uppercase letters, lowercase letters and/or digits, but that any number of hyphens may be present. you can assume that a hyphen will not appear as the first or last character of the string. do not assum
Answers: 3
question
Computers and Technology, 25.06.2019 12:00
The user needs to add a thick dark green border around a chart in powerpoint. the user can do this in chart tools by choosing?
Answers: 1
You know the right answer?
Write a program that tells what coins to give out for any amount of change from 1

cent t...
Questions
Questions on the website: 13722362