Computers and Technology

Write a program that allows a user to input numbers (integers) into a two-dimensional array. Include the following:-Declare a 2-dimensional array named: numArray. o The array should be 3 rows x 4 columns - (although you can try different sizes).-Pass the array to a function named: getDatao The function should prompt the user to enter values (see output).o Use nested for loops to read in the data.-Once the data has been entered, pass the array to a function named: displayArrayo Clear the screen before displaying the data. o Use nested for loops to output the data. o Format the numbers so that they are aligned to the right in each column. o Space the columns evenly (see output). /* OUTPUT: Enter integers into the 2-Dimensional array: erver Explorer Toolbox Source. cpp" Project40 #include #include #include using namespace std; int const ROWS = 3; int const COLS = 4; void getData(int numArray[ROWS][COLS]); void displayArray(int numArray[ROWS] [COLS]); Fint main() int nunArray[ROWS] [COLS]; getData(numArray); display Array(numArray); system("pause"); return; void getData(int numArray[ROWS][COLS]) for(int i = 0; i < ROWS; i++) for (int j = 0; j < COLS; j++) cout << "Enter a number: \n"; cin >> nunArray[i][j]; Evoid displayArray(int numArray[ROWS][COLS]) for (int i = 0; i < ROWS; i++) for (int j = 0; j < COLS; j++) cout << numArray[i][s] << setprecision (2); I 60 % - O Ready 6 Enter a number: 1 Enter a number: 45 Enter a number: 765 Enter a number: Enter a number: 32 Enter a number: 45 Enter a number: 789 Enter a number: 343 Enter a number: 22 Enter a number: 64 Enter a number: 12 Enter a number: 555 Here is the data in the 2-Dimensional array: 1 45 765 6 32 45 789 343 22 64 12 555 Press any key to continue */

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 13:30, lissa34
Qr or codes let any piece of print host a link to online information.
Answers: 3
image
Computers and Technology, 23.06.2019 12:00, deflox74
What does the level 1 topic in a word outline become in powerpoint? a. first-level bullet item b. slide title c. third-level bullet item d. second-level bullet item
Answers: 1
image
Computers and Technology, 23.06.2019 22:00, rocksquad9125
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
image
Computers and Technology, 24.06.2019 06:30, hannahgracew12
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
Do you know the correct answer?
Write a program that allows a user to input numbers (integers) into a two-dimensional array. Include...

Questions in other subjects:

Konu
Health, 27.03.2020 18:49
Konu
Mathematics, 27.03.2020 18:49
Konu
Computers and Technology, 27.03.2020 18:49