Question: 5 . 8 Lab Exercise Ch . 5 a: Array Swap / Reverse Write and debug this program in Visual Studio, then upload Source.cpp to

5.8 Lab Exercise Ch.5a: Array Swap/Reverse
Write and debug this program in Visual Studio, then upload Source.cpp to Zylab.
Use what you learned about array reversal loops in the preceding exercise.
Prompt the user to enter a list of up to 20 integers, and a non-numeric to quit.
In a loop, read the inputs into an array you've already declared of length 20.
Hint: you can detect the non-numeric has been entered, while reading in the values, using:
```
int number[20], i=0;
while (cin >> number[i] && i 20)//cin returns "false" if invalid entry (non-numeric)
{
i++;
}
```
Print out the array, all elements on one line, terminated with a newline.
Reverse the array by swapping elements.
Re-print the array reversed.
Assuming the user will enter "12345 q", your code should print:
"Enter a list of up to 20 integers, and a non-numeric to quit: "
"The original array is: 12345"
"The reversed array: 54321"
5 . 8 Lab Exercise Ch . 5 a: Array Swap / Reverse

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 Programming Questions!