Question: c++, use the round function and test to see if when you enter $29.24 the output is 4 pennies. dont use if statements and loops
Write a program that helps a cashier make change the program gets a dollar amount from the user and calculates and displays how to make the change amount entered using the smallest number of bills and coins possible (The change should be made by first giving the maximum number of dollars followed by the maximum number of quarters, then dimes, nickels and finally pennies te Your answer should never have more than 3 quarters, 2 ames, 1 nickel, or 4 pennies. You may assume that only amounts greater than $0 will be entered Hint Convert the amount entered by the user to pennies rounding up to the nearest integer, using the round function from math You do not need and cannot use decisions in your solution For example, if the user enters 1939 the output of your program should be as shown below. Note there is one tab before each of the quantities of dollars, quarters, etc Change Duet 13 dollar 1 quarters Oriekela pennies Make sure you include a clear and explicit prompt asking the user to enter the amount of the chance to be made in dollars Clearly label each output including the units In your IDE, not for submission, investigate what happens if you don't use the round function when the input in 414 Think about what causes this Additional Requirements To complete this assignment you are ONLY allowed to use what is discussed in Chapters 1 - 3 of the text and lectures If you already know how to program refrain from using more advanced constructs or ibrary routines. The problem can and should be solved using only what we have leared in the course You must follow the style guidelines described in the document named (Programming Style Guidelines) provided in eLearning. Be sure you have reviewed the style guidelines carefully
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
