subject

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 */

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:00, dadonelson2109
If your accelerator suddenly gets stuck what should you do
Answers: 2
image
Computers and Technology, 22.06.2019 19:30, mitalichavez1
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 3
image
Computers and Technology, 23.06.2019 09:30, nsjcbdhcb
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
image
Computers and Technology, 23.06.2019 10:00, karissanichole18
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
You know the right answer?
Write a program that allows a user to input numbers (integers) into a two-dimensional array. Include...

Questions in other subjects:

Konu
Health, 28.03.2021 22:50
Konu
Mathematics, 28.03.2021 22:50
Konu
Mathematics, 28.03.2021 22:50