Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Programming Language Please write a complete program that meets the followin

ID: 3626415 • Letter: C

Question

C++ Programming Language

Please write a complete program that meets the following specifications:

* Declares two 10 element integer arrays named front and back.

* Asks the user to fill the array front and accepts values for each entry from the user.

* Copies the entries in front to the array back in reverse order. That is, the first entry of front should be the last entry of back. The second entry of front should be the next to last entry of back and so on.

* Displays the entries in both arrays in three columns. The first column is the index, the second is the value in the corresponding entry in front, the last column is the value for the corresponding entry in the array back.

* You can use tabs to separate the columns. The table should have 10 rows.

If correctly done, this program should use at most three loops (one for input, one for copying the values and one for display), but it can be done in two.

Explanation / Answer

#include #include int main() { int front[10]; int back[10]; for (int i = 0; i < 10; i++) { printf("%s ", "Please enter a value to store in the array:"); scanf("%d", &front[i]); back[9-i] = front[i]; } printf("%s %s %s ", "Index", "Front", "Back"); for (int i = 0; i < 10; i++) printf("%d %d %d ", i, front[i], back[i]); return 0; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote