Question
You will get practice in this assignment in the following areas in C/C++: Writing a simple C++ program Compiling and linking Logical expressions Simple arithmetic
You will get practice in this assignment in the following areas in C/C++: Writing a simple C++ program Compiling and linking Logical expressions Simple arithmetic and/or assignment statements Standard Input and output Variable Declaration Simple If statements Simple while statement Declaring constants and variables Good programming practices
Programming Specifications: 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.
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