Question: in c + + implement the function bool getCoins ( int coins , int numCoins, int total, int s ) ; The function returns true
in c implement the function
bool getCoinsint coins int numCoins, int total, int ;
The function returns true if some subset of five "coins" from the coins array adds up to the given total. Otherwise the function returns false. If the function returns true then the first five elements of will be populated with the indexes of coins that were used to make the given total. Note that we do not require the values in coins to be of the usual denominations; each coin can be any positive whole number.
Example
int coins :
int chosen;
bool found getCoins chosen:
found would be set to true and the elements of chosen might be set to
Absolutely no function calls and no material beyond Chapter of the textbook.
To get credit. your code should not be overly long or complicated. Around lines of code should be enough.
Copy paste a program with your function and a main that tests it extensively. Also copy paste your output from a sample run.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
