An array called number contains 20 integer values and must be filled with values in the following way:  Fill the array with consecutive even numbers starting from 10.  Start again at the first element and increase every fourth element with 3.  Replace the value of the first four elements each with its square.  Deduct 2 from the last 3 elements.  Swap the value of element 5 and element 15.  Add the value of the first element to that of the last element  Add consecutive integers (starting from 1) to all even elements. Remember, the first element has a subscript of 0 and the last element (element 20) has a subscript of 19. The following must be displayed:  All elements must be displayed each on a new line. Identify each element clearly.  Display the highest value in the array.  The lowest value in the array must be displayed.  Count and display how many even values and how many odd values the array contains

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.4: Arrays As Arguments
Problem 6E: (Electrical eng.) Write a program that declares three one-dimensional arrays named volts, current,...
icon
Related questions
Question

An array called number contains 20 integer values and must be filled with values in the
following way:
 Fill the array with consecutive even numbers starting from 10.
 Start again at the first element and increase every fourth element with 3.
 Replace the value of the first four elements each with its square.
 Deduct 2 from the last 3 elements.
 Swap the value of element 5 and element 15.
 Add the value of the first element to that of the last element
 Add consecutive integers (starting from 1) to all even elements.
Remember, the first element has a subscript of 0 and the last element (element 20)
has a subscript of 19.
The following must be displayed:
 All elements must be displayed each on a new line. Identify each element clearly.
 Display the highest value in the array.
 The lowest value in the array must be displayed.
 Count and display how many even values and how many odd values the array
contains.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning