Question: C++ basic array problem const int SIZE = 10; int nums[SIZE] = {5,4,2,7,6,8,5,2,8,14}; Write code to perform the following array operations (Note that the number

C++ basic array problem

const int SIZE = 10; int nums[SIZE] = {5,4,2,7,6,8,5,2,8,14};

Write code to perform the following array operations (Note that the number of clues vary, just because a [____] is not explicitly written in does not mean there should not be brackets).

//#1 Square each number ((i.e., multiply each by itself)

for (int i ___; i < _____; i++)

{

____[i] = ______*_____;

}

//#2 Add a random number between zero and 10 to

// each number.

_________________________________

_____ += ________;

//#3 Add to each number the number that follows in the

// array. Skip the last value in the array.

for (int i = 0; i < _____; i++)

{

_____ += ______[____];

}

/#4 Calculate the sum of all the numbers.

_____ ________ = ____;

for (int i = 0; i < SIZE; i++)

{

______ += ________;

}

//#5 Display the largest number in the array

//Youre on your own here!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!