Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

1.who the father of Ayurveda? 2. Who the father of taxonomy?

Answered: 1 week ago

Question

Commen Name with scientific name Tiger - Wolf- Lion- Cat- Dog-

Answered: 1 week ago