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 3 quarters, 6 dimes, and 5 nickels, you could optimally get the $1.60 with 6 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.
 Create a coin class with four fields representing the number of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!