Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

Describe how ADSL operate and how it is related to SNR.

Answered: 1 week ago

Question

2. Place a value on the outcomes.

Answered: 1 week ago