Question
Using C++ Part 2 - Cash.cpp Write a function called SortCash() that has eight (8) parameters. The first parameter should be a pass by value
Using C++
Part 2 - Cash.cpp
Write a function called SortCash() that has eight (8) parameters. The first parameter should be a pass by value integer that represents a total dollar amount. The remaining seven parameters should also be integers but passed by reference. These reference parameters will represent standard Canadian currency amounts: hundred dollar bills, fifty dollar bills, twenties, tens, fives, toonies and loonies, respectively in that order.
The function should convert the total dollar amount into the least number of equivalent bills/coins. Using references, the function should directly alter the respective arguments of the calling function. This function should only handle processing. Input and output to the console should not be in this function.
Include the function in a working program which prompts the user for the total dollar amount and shows them the list of equivalent bill/coin quantities. Loop this IPO structure 3 times. Be sure to validate for non-numeric input by including the MyInputValidation.h custom header file. The minimum allowable dollar amount is one (1), the maximum is one thousand (1000).
Cash.cpp: Please enter a total dollar amount 456 unber of Loonies: umber of Toonies: umber of Fives: umber of Tens umber of Twenties: umber of Fifties: umber of Hundreds 0 4 lease enter a total dollar amount 37 umber of Loonies: 0 mber of Toonies: umber of Fives: umber of Tens umber of Twenties: umber of Fifties: umber of Hundreds: 0 Please enter a total dollar amount 212 umber of Loonies: umber of Toonies: umber of Fives: umber of Tens: umber of Twenties: umber of Fifties: unber of Hundreds 0 0 0 Press any key to continueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started