I’ve attached a picture of the program i wrote before and now they want us to replace programmer-defined inputs with console inputs. I already did the exercise 3.4 and attached it as a photo, but don’t how to modify it

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
I’ve attached a picture of the program i wrote before and now they want us to replace programmer-defined inputs with console inputs. I already did the exercise 3.4 and attached it as a photo, but don’t how to modify it.
1:30
◄ Search
< Back
Sep 21, 2022 at 8:44 PM
#include <iostream>
using namespace std;
Dashboard
int main() (
int cashPayment 45000;
int amount Tendered = 100000;
int changeDue amount Tendered - cashPayment;
cout << "Cash payment amount: "<<cashPayment << endl; cout << "Tendered amount:
<< amount Tendered << endl; cout << "Change due: << changeDue << endl;
cout << "Change paid out in: << endl;
int hundredThousands changeDue / 100000;
changeDue changeDue % 100000;
int tenThousands = changeDue / 10000;
changeDue changeDue % 10000;
int five Thousands changeDue / 5000;
changeDue changeDue % 5000;
int thousand changeDue / 1000;
changeDue changeDue % 1000;
int five Hundred changeDue / 500;
changeDue changeDue & 500;
int hundred
changeDue
int fifty
changeDue
Submission
2.14 Programming Lab 1
int twenty
changeDue
int ten changebue 10:
changeDue changeDue % 10;
cout <<
cout <<
cout
cout <<
cout <<
cout
int five changebue/5
changedue changeDue % 10;
cout <<
cout <<
cout <<
changeDue / 500;
changeDue % 500;
int two changeDue / 2;
changeDues changeDue % 2:
cout <<
cout
cout <<
changeDue / 50;
changeDue % 50;
int one changeDue / 1;
changeDue changeDue % 1;
}
Comments
changeDue / 20;
changeDue % 20;
this many hundred thousand dollar bills:" << hundredThousands << endl;
this many ten thousand dollar bills:" << tenThousands << endl;
this many five thousand dollar bills:" fiveThousands << endl;
this many thousand dollar bills: << thousand << endl;
this many five hundred dollar bills:" << fiveHundred << endl;
this many hundred dollar bills: << hundred << endl;
this many fifty dollar bills: << fifty << endl;
this many twenety dollar bills: << twenty << endl;
this many ten dollar bills: << ten << endl;
<< five << endl;
two << endl;
<< one << endl;
this many five dollar bills:
this many two dollar bills:
this many one dollar bills:
Calendar
Files (3)
To Do
Q
5
C
Notifications
Rubric
Inbox
Transcribed Image Text:1:30 ◄ Search < Back Sep 21, 2022 at 8:44 PM #include <iostream> using namespace std; Dashboard int main() ( int cashPayment 45000; int amount Tendered = 100000; int changeDue amount Tendered - cashPayment; cout << "Cash payment amount: "<<cashPayment << endl; cout << "Tendered amount: << amount Tendered << endl; cout << "Change due: << changeDue << endl; cout << "Change paid out in: << endl; int hundredThousands changeDue / 100000; changeDue changeDue % 100000; int tenThousands = changeDue / 10000; changeDue changeDue % 10000; int five Thousands changeDue / 5000; changeDue changeDue % 5000; int thousand changeDue / 1000; changeDue changeDue % 1000; int five Hundred changeDue / 500; changeDue changeDue & 500; int hundred changeDue int fifty changeDue Submission 2.14 Programming Lab 1 int twenty changeDue int ten changebue 10: changeDue changeDue % 10; cout << cout << cout cout << cout << cout int five changebue/5 changedue changeDue % 10; cout << cout << cout << changeDue / 500; changeDue % 500; int two changeDue / 2; changeDues changeDue % 2: cout << cout cout << changeDue / 50; changeDue % 50; int one changeDue / 1; changeDue changeDue % 1; } Comments changeDue / 20; changeDue % 20; this many hundred thousand dollar bills:" << hundredThousands << endl; this many ten thousand dollar bills:" << tenThousands << endl; this many five thousand dollar bills:" fiveThousands << endl; this many thousand dollar bills: << thousand << endl; this many five hundred dollar bills:" << fiveHundred << endl; this many hundred dollar bills: << hundred << endl; this many fifty dollar bills: << fifty << endl; this many twenety dollar bills: << twenty << endl; this many ten dollar bills: << ten << endl; << five << endl; two << endl; << one << endl; this many five dollar bills: this many two dollar bills: this many one dollar bills: Calendar Files (3) To Do Q 5 C Notifications Rubric Inbox
1:27
◄ Search
Back
Programming Exercise 5.3
Making Change, v.2.0
Purpose. Practice writing programs that use console keyboard input.
Modification of Exercise 3.4's changeDuel.cpp, replacing programmer-defined inputs with console
inputs. Name the new program changeDue2.cpp.
Requirements:
1. Write this program by copying, pasting, and marking up Exercise 3.4's changeDuel.cpp.
2. Expect the user input "cash payment" to be less than or equal to the amount "tendered".
3. Expect the user input "cash payment" to not 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.
Program I/O. Input: 2 console input whole numbers for the "cash payment" and for the amount
"tendered" Output: The "change due" and the numbers of each specified denomination to be "paid
out".
5.3.pdf
Example. Here's what the output should look like, with user input in blue:
Cash payment amount: 45000
Tendered amount: 100000
Change due: 55000
Change paid out in:
this many hundred thousand dollar bills: 0
this many ten thousand dollar bills: 5
this many five thousand dollar bills: 1
this many thousand dollar bills: 0.
C
this many five hundred dollar bills: 0
this many hundred dollar bills: 0.
this many fifty dollar bills: 0.
this many twenty dollar bills: 0.
this many ten dollar bills: 0
this many five dollar bills: 0
this many two dollar bills: 0
this many one dollar
0.
bills:
Dashboard
188
Calendar
To Do
5
C
Notifications
Inbox
Transcribed Image Text:1:27 ◄ Search Back Programming Exercise 5.3 Making Change, v.2.0 Purpose. Practice writing programs that use console keyboard input. Modification of Exercise 3.4's changeDuel.cpp, replacing programmer-defined inputs with console inputs. Name the new program changeDue2.cpp. Requirements: 1. Write this program by copying, pasting, and marking up Exercise 3.4's changeDuel.cpp. 2. Expect the user input "cash payment" to be less than or equal to the amount "tendered". 3. Expect the user input "cash payment" to not 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. Program I/O. Input: 2 console input whole numbers for the "cash payment" and for the amount "tendered" Output: The "change due" and the numbers of each specified denomination to be "paid out". 5.3.pdf Example. Here's what the output should look like, with user input in blue: Cash payment amount: 45000 Tendered amount: 100000 Change due: 55000 Change paid out in: this many hundred thousand dollar bills: 0 this many ten thousand dollar bills: 5 this many five thousand dollar bills: 1 this many thousand dollar bills: 0. C this many five hundred dollar bills: 0 this many hundred dollar bills: 0. this many fifty dollar bills: 0. this many twenty dollar bills: 0. this many ten dollar bills: 0 this many five dollar bills: 0 this many two dollar bills: 0 this many one dollar 0. bills: Dashboard 188 Calendar To Do 5 C Notifications Inbox
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

what about requirements 2 and 3? it should either us if/else statements or a loop.

 

Purpose. Practice writing programs that use console keyboard input.
Modification of Exercise 3.4's changeDuel.cpp, replacing programmer-defined inputs with console
inputs. Name the new program changeDue2.cpp.
Requirements:
1. Write this program by copying, pasting, and marking up Exercise 3.4's changeDuel.cpp.
2. Expect the user input "cash payment" to be less than or equal to the amount "tendered".
3. Expect the user input "cash payment" to not 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.
Program I/O. Input: 2 console input whole numbers for the "cash payment" and for the amount
"tendered" Output: The "change due" and the numbers of each specified denomination to be "paid
out".
Example. Here's what the output should look like, with user input in blue:
Cash payment amount: 45000
Tendered amount: 100000
Change due: 55000
Change paid out in:
this many hundred thousand dollar bills: 0
C
ZOOM
Transcribed Image Text:Purpose. Practice writing programs that use console keyboard input. Modification of Exercise 3.4's changeDuel.cpp, replacing programmer-defined inputs with console inputs. Name the new program changeDue2.cpp. Requirements: 1. Write this program by copying, pasting, and marking up Exercise 3.4's changeDuel.cpp. 2. Expect the user input "cash payment" to be less than or equal to the amount "tendered". 3. Expect the user input "cash payment" to not 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. Program I/O. Input: 2 console input whole numbers for the "cash payment" and for the amount "tendered" Output: The "change due" and the numbers of each specified denomination to be "paid out". Example. Here's what the output should look like, with user input in blue: Cash payment amount: 45000 Tendered amount: 100000 Change due: 55000 Change paid out in: this many hundred thousand dollar bills: 0 C ZOOM
Solution
Bartleby Expert
SEE SOLUTION
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY