Write a function named change that has an integer parameter


Write a function named change() that has an integer parameter and six integer reference parameters named hundreds, fifties, twenties, tens, fives, and ones. The function is to consider the passed integer value as a dollar amount and convert the value into the fewest number of equivalent bills. Using the reference parameters, the function should alter the arguments in the calling function. Your function should return a -1 if the user enters an invalid amount of money, e.g. a negative amount. Otherwise, your function should return a 1, indicating a successful changing of money. Include the function written above in a working program. Make sure your function is called from main() and returns a value to main() correctly. Have main() use a cout statement to display the returned value.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a function named change that has an integer parameter
Reference No:- TGS02797592

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)