Question

Refer to the following array definition for questions 1 & 2 int numberArray[9)[11] 1. Write a statement that assigns 145 to the first column of the first row of this array. 2. Write a statement that assigns 18 to the last column of the last row of this array. values is a two-dimensional array of floats, with 10 rows and 20 columns. Write code that sums all of the elements in the array and stores the sum in the variable total 3. 4. Find the error in the following code. int size; double values[sizel: 5. Find the error in the following code. char greetingl) - Heo cout << greeting Show the values in the array elements after each pass of the outer loop to sort the array in ascending order using the bubble sort algorithm. HINT: Look at the sorting practice handout for help. 6. 7. Indicate which is the last pass and why.一一 Subscr Valu Pass 2 Pass 3 Pass ipt 111 28 12] 10 13] 67 14] 34
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 1:

numberArray[0][0]=145;

Answer 2:

numberArray[8][10]=18;

Answer 3:

for(int i=0;i<values.length;i++)

for(int j=0;j<values[i].length;j++)

sum+=values[i][j];

Answer 4:

size of array must be constant, we can not use variable for creating array

Answer 5:

No error in the code

Answer 6:

Before Sort

28,10,50,34,67,

10,28,34,50,67,

10,28,34,50,67,

10,28,34,50,67,

10,28,34,50,67,

After Sort:

10,28,34,50,67,

Add a comment
Know the answer?
Add Answer to:
Refer to the following array definition for questions 1 & 2 int numberArray[9)[11] 1. Write a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT