Question
1. Your program must produce the minimal bill and coin count. 2. Your program must accept values between 1 and 1,000,000 pennies. If a number
1. Your program must produce the minimal bill and coin count. 2. Your program must accept values between 1 and 1,000,000 pennies. If a number is entered outside that range your program should continue to ask for a valid number. 3. No Global Variables BUT your program must use global constants. 4. You must use declared constants in your program and not literal values. 5. Only print out non-zero values.. So, if there are no Fives .then dont print zero fives. Design Considerations/Algorithms To see if you need to issue 100 dollar bills you divide the amount of pennies by the number of pennies in a 100 dollar bill. You should make this a constant in your program along with the number of pennies in the other demoninations. Remember to keep track of the number of pennies remaining after each denomination. Divide the number of pennies by the amount of pennies in a 100, keep track of that number and the remainder. Take the reminder from the 100's calculation and divide by the number of pennies in a 50's. Keep track of the number and the remainder. Take the reminder from the 50's calculation and divide by the number of pennies in a 20's. Keep track of the number and the remainder. Take the reminder from the 20's calculation and divide by the number of pennies in a 10's. Keep track of the number and the remainder. Take the reminder from the 10's calculation and divide by the number of pennies in a 5's. Keep track of the number and the remainder. Take the reminder from the 5's calculation and divide by the number of pennies in a 1's. Keep track of the number and the remainder. Take the reminder from the 1's calculation and divide by the number of pennies in a quarters. Keep track of the number and the remainder. Take the reminder from the quarter's calculation and divide by the number of pennies in a dime. Keep track of the number and the remainder. Take the reminder from the Dime's calculation and divide by the number of pennies in a nickel. Keep track of the number and the remainder. That which is left over is the number of pennies. Do not print out any value that is zero. Grading Criteria: The program compiles. If the program does not compile nofurther grading can be done. (25 Points) The program executes without exception and produces output. The grading of the output cannot be accomplished unless the program executes. (5 Points) No global variables but uses global constants (10 Points) Queries for the correct input. (10 Points) Does not print out zero values. (10 Points) Produces minimal bill and coin count (10 Points) Answes are correct (10 Points) Formatting matches example output as close as possible. (5 Points) The program is documented (commented) properly. (5 Points) Use constants when values are not to be changed (5 Points) Use proper indentation (5 Points) Use good naming standards Sample Output: Please enter in the total number of pennies The number must be between 1 and 1,000,000 Please omit the commas in the number. 123425 Hundreds =12 Twenties =1 Tens =1 Ones =4 Quarters =1
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