John is a great collector of pennies. He wants to exchange his jar of pennies for as many quarters, dimes, and nickels. Any amount left over he will put back in his jar to save. Task: Design and code a Java program that will output the maximum number of quarters, dimes, and nickels and how many leftover pennies John will receive for his stash of pennies. He does not know how many pennies are in the jar, but he is certain that he has no more than 9999 pennies. Input: number of pennies (integer) Output Example: 123456789012345678901234567890123456789012345678901 Coin Conversion Number of Quarters XX Number of Dimes XX Number of Nickels X Remaining Pennies X Hint: Use appropriate variable names and constants where applicable.
John is a great collector of pennies. He wants to exchange his jar of pennies for as many quarters, dimes, and nickels. Any amount left over he will put back in his jar to save.
Task:
Design and code a Java program that will output the maximum number of quarters, dimes, and nickels and how many leftover pennies John will receive for his stash of pennies. He does not know how many pennies are in the jar, but he is certain that he has no more than 9999 pennies.
Input: number of pennies (integer)
Output Example:
123456789012345678901234567890123456789012345678901
Coin Conversion
Number of Quarters XX
Number of Dimes XX
Number of Nickels X
Remaining Pennies X
Hint:
- Use appropriate variable names and constants where applicable.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images