File Edit Options Buffers Tools Text Help emacs1612-podium.dsm.fordham.edu Save Undo Write a C++ program that: 1. Initializes an integer array of size 15 with random integers each in range [1,r], where r is some positive constant greater than 1. 2. Accepts from the keyboard a positive integer value of variable pair_sum, such that 1 <= pair_sum <= r. 3. Prints the array contents. 4. Prints all pairs of positions in the array for which the array elements add up to the value of pair sum. 5. Your main program must contain only function calls, except possibly simple cout statements. 6. A sample output of your program could be: Enter positive value for pair_sum: 10 Array values: 6 8 9 10 2 8 18 3 6 3 9 Pairs of positions for which sum is 10 pos-1 pos-2 4 1 13 4 5 4 7 4 12 4 14 13 Enter positive value for pair_sum: 10 6. 11 13 Array values: 6 8 9 10 2 8 1 8 3 6 3 9 8 2 12 13 13 14 Pairs of positions for which sum is 10 (Text) -: --- fn-s22.txt Bot L16 (Text) fn-s22.txt Top L1 - :---

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

IN C++ please picture attached

File Edit Options Buffers Tools Text Help
emacs@1612-podium.dsm.fordham.edu
XSave
Undo
Write a C++ program that:
O
Enter positive value for pair_sum: 10
1. Initializes an integer array of size 15 with
random integers each in range [1,r], where r is
some positive constant greater than 1.
2. Accepts from the keyboard a positive integer
value of variable pair_sum, such that
1 <= pair_sum <= r.
3. Prints the array contents.
4. Prints all pairs of positions in the array for
which the array elements add up to the value of
pair_sum.
5. Your main program must contain only function
calls, except possibly simple cout statements.
6. A sample output of your program could be:
Array values: 6 8 9 10 2 8 1 8 3 6 3 9
: 8
Pairs of positions for which sum is 10
pos-1 pos-2
1 4
1
13
6.
4.
4
7
4
12
14
13
Enter positive value for pair_sum: 10
6.
11
7
13
12
13
Array values: 6 8 9 10 2 8 1 8 3 6 3 9 8 2-
13 14
8
Pairs of positions for which sum is 10
(Text)
fn-s22.txt
Bot L16
(Text)
fn-s22.txt
Тop L1
-: ---
Transcribed Image Text:File Edit Options Buffers Tools Text Help emacs@1612-podium.dsm.fordham.edu XSave Undo Write a C++ program that: O Enter positive value for pair_sum: 10 1. Initializes an integer array of size 15 with random integers each in range [1,r], where r is some positive constant greater than 1. 2. Accepts from the keyboard a positive integer value of variable pair_sum, such that 1 <= pair_sum <= r. 3. Prints the array contents. 4. Prints all pairs of positions in the array for which the array elements add up to the value of pair_sum. 5. Your main program must contain only function calls, except possibly simple cout statements. 6. A sample output of your program could be: Array values: 6 8 9 10 2 8 1 8 3 6 3 9 : 8 Pairs of positions for which sum is 10 pos-1 pos-2 1 4 1 13 6. 4. 4 7 4 12 14 13 Enter positive value for pair_sum: 10 6. 11 7 13 12 13 Array values: 6 8 9 10 2 8 1 8 3 6 3 9 8 2- 13 14 8 Pairs of positions for which sum is 10 (Text) fn-s22.txt Bot L16 (Text) fn-s22.txt Тop L1 -: ---
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
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