The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Hey,Â
I guess u remember me. Looks like I messed up somewhere trying to put in the loops. If you can, please rewrite the code using loops. That would be very hepful. Thank you so much for all your help.Â
LianaÂ
Â
Â
In this assignment you will design a program to give customers the correct change. Here are the parameters:
1) Coins to use and their values: Half Dollars (50) Quarter Dollars (25) Dimes (10) Nickels (5) Pennies (1) The user will enter a number between 1 and 99. If the number is outside of that range, you will inform the user
and terminate the program. 0 You will use as few coins as possible. For example, if the user enters "50", you will give the answer as "One
Half Dollar" and not "5 Dimes" or "50 Pennies". a You will loop through each coin denomination, with the possible exception of the penny. Here is a hint:
o If the number is 99, then subtract 50 from the numb W‘ his leaves 49, with one half dollar
used.
0 Next, subtract 25 from the total sing a loop.
0 Next, subtract 10 cents from the 'a‘ '. '
0 Finally record the four pennies left over. *- is leaves 24, with one quarter used
. oop. This will leave 4 cents, with two dimes used. o The output should read something like: "You have one half dollar, one quarter, two dimes, and four
pennies".