Question: Create a coin class with four fields representing the number of quarters, dimes, nickels, and pennies. Include a totalValue ( ) method that returns the
Create a coin class with four fields representing the number of quarters, dimes, nickels, and pennies. Include a totalValue method that returns the value of the coins. Also include an optimalCoins method that prints out the best way to get that amount of money for instance if you put in quarters, dimes, and nickels, you could optimally get the $ with quarters and a dime. Write a driver program named CoinCount that asks the user for the number of each type
of coin. Print out the number of each coin and the total value. Then add an optimal way to create that amount of money. Add a loop your choice on how to end that then prints the total number of coins and the total amount of money.
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
