Question: Programming Exercise 3.4 Making Change, v.1.0 Purpose. Learn how to write a rather lengthy program, by completing another, partially written one. Write a program named

Programming Exercise 3.4 Making Change, v.1.0 Purpose. Learn how to write a rather lengthy program, by completing another, partially written one. Write a program named changeDue1.cpp to calculate change due in a transaction using these U.S. bills -no cents: $1 $2 $5 $10 $20 $50 $100 $500 $1,000 $5,000 $10,000 $100,000 For example, a "cash payment of $45,000 is made by tendering" a $100,000 bill. The "change due is $55,000. It's paid out" in five $10,000 bills, and one $5,000 bill. In another example, a cash payment of $44,999 is made by tendering five $10,000 bills. The change due is $5,001. It's paid out in one $5,000 bill, and one $1 bill. Requirements: 1. Write this program by copying, pasting, and completing the "starting point" provided below. Name the variables as you wish. 2. The "cash payment" is always less than or equal to the amount "tendered. 3. The "cash payment" cannot be zero or negative. 4. The paid out bills should include the fewest number of bills. That is, don't include two $10 bills when you can include one $20 bill instead. 5. Include a label with any statement that outputs a variable's value. Algorithm. This is only a partial algorithm, to calculate the number of bills of a certain denomination to paid out. For example, for $100 bills be paid out: Divide the change due by 100 to get the number of $100 bills in the change. Recalculate the change due as the remainder in the above division problem. Output the number of $100 bills, with a label. Program I/O. Input: 2 programmer-assigned whole number values of your choosing, for the "cash payment" and for the amount "tendered" Output: The "change due" and the numbers of each specified denomination to be "paid out. Programming Exercise 3.4 Making Change, v.1.0 Purpose. Learn how to write a rather lengthy program, by completing another, partially written one. Write a program named changeDue1.cpp to calculate change due in a transaction using these U.S. bills -no cents: $1 $2 $5 $10 $20 $50 $100 $500 $1,000 $5,000 $10,000 $100,000 For example, a "cash payment of $45,000 is made by tendering" a $100,000 bill. The "change due is $55,000. It's paid out" in five $10,000 bills, and one $5,000 bill. In another example, a cash payment of $44,999 is made by tendering five $10,000 bills. The change due is $5,001. It's paid out in one $5,000 bill, and one $1 bill. Requirements: 1. Write this program by copying, pasting, and completing the "starting point" provided below. Name the variables as you wish. 2. The "cash payment" is always less than or equal to the amount "tendered. 3. The "cash payment" cannot be zero or negative. 4. The paid out bills should include the fewest number of bills. That is, don't include two $10 bills when you can include one $20 bill instead. 5. Include a label with any statement that outputs a variable's value. Algorithm. This is only a partial algorithm, to calculate the number of bills of a certain denomination to paid out. For example, for $100 bills be paid out: Divide the change due by 100 to get the number of $100 bills in the change. Recalculate the change due as the remainder in the above division problem. Output the number of $100 bills, with a label. Program I/O. Input: 2 programmer-assigned whole number values of your choosing, for the "cash payment" and for the amount "tendered" Output: The "change due" and the numbers of each specified denomination to be "paid out
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
