Write a C++ program that declares an array myList of 50 components of type integer. Initialize the array so that the first 25 components are equal to the square of the index variable and the last 25 components equal to doubles the index variable. The program then calculates the sum and average of elements. In addition, the program counts elements greater than or equal to average and elements less than average. Output the array so that 10 elements per line are printed. Sample input / output: List Elements: 0 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484 529 576 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 Sum of elements: 6750 Average of elements: 135 Elements greater than or equal to 135 is 13 Elements less than 135 is 37

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
Write a C++ program that declares an array myList of 50 components of type integer. Initialize
the array so that the first 25 components are equal to the square of the index variable and the last
25 components equal to doubles the index variable. The program then calculates the sum and
average of elements. In addition, the program counts elements greater than or equal to average
and elements less than average. Output the array so that 10 elements per line are printed.
Sample input / output:
List Elements:
1 4
9
16
25
36
49
64
81
100
121
144
169
196
225
256
289
324
361
400
441
484
529
576
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
Sum of elements: 6750
Average of elements: 135
Elements greater than or equal to 135 is 13
Elements less than 135 is 37
Transcribed Image Text:Write a C++ program that declares an array myList of 50 components of type integer. Initialize the array so that the first 25 components are equal to the square of the index variable and the last 25 components equal to doubles the index variable. The program then calculates the sum and average of elements. In addition, the program counts elements greater than or equal to average and elements less than average. Output the array so that 10 elements per line are printed. Sample input / output: List Elements: 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484 529 576 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 Sum of elements: 6750 Average of elements: 135 Elements greater than or equal to 135 is 13 Elements less than 135 is 37
Expert Solution
steps

Step by step

Solved in 2 steps with 3 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