Question
Write a program to convert pennies from a penny jar into dollars, quarters, dimes, and nickels. Begin by retrieving the number of pennies from the
Write a program to convert pennies from a penny jar into dollars, quarters, dimes, and nickels. Begin by retrieving the number of pennies from the end user. If the amount of pennies entered is > 5, determine the number of $1 bills, quarters, dimes, and nickels that can be used to replace the pennies. Report the original number of pennies along with the equivalence in dollars, quarters, dimes, and nickels. An error message should be reported if a negative value is entered for the amount of pennies
exsample output
1.how many pennies do you have 268
268 pennies can be converted to
2 dollar(s); 2 quarter(s); 1 dime(s); 1 nickel(s); and 3 pennies (left over)
--------------
error checking should be
how many pennies you have
3
sorry 5 pennies is the minimum
how many pennies you have
-3
sorry its not possible to have negitive pennies
can you write this in java ?
Step 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