Question: Practice 03: Two dimensional arrays (15 marks) 1. Study the program below to understand the task performed and how two-dimensional arrays are created. 1/Practice 6.3

 Practice 03: Two dimensional arrays (15 marks) 1. Study the programbelow to understand the task performed and how two-dimensional arrays are created.1/Practice 6.3 1/Demonstration of two-dimensional arrays #include #include using namespace std; constint NO_OF_ROWS = 2; const int NO_OF_COLS = 4; typedef float NewType

[NO_OF_ROWS] [NO_OF_COLS]; //declares a new data type // which is a 2

dimensional array of floats Newtype val; // defines val as a 2

Practice 03: Two dimensional arrays (15 marks) 1. Study the program below to understand the task performed and how two-dimensional arrays are created. 1/Practice 6.3 1/Demonstration of two-dimensional arrays #include #include using namespace std; const int NO_OF_ROWS = 2; const int NO_OF_COLS = 4; typedef float NewType [NO_OF_ROWS] [NO_OF_COLS]; //declares a new data type // which is a 2 dimensional array of floats Newtype val; // defines val as a 2 dimensional array of NewType void getData(); //prototype of getData void displayData(NewType array); //prototype of displayData int main() { getData(); //call getData function and transfer nothing system ("pause"); return 0; } // getData // // task: This function receive inputs from user // data in: None // data returned: None void getData() { int noof Input=0; cout > val[row_pos][col_pos]; } } displayData(val); //call displayData function and transfer array val } // displayData 5 // task: This function displays all entered inputs // // data in: the array containing val // data returned: none void displayData (NewType array) for (int row_pos= 0; row_pos #include using namespace std; const int NO_OF_ROWS = 2; const int NO_OF_COLS = 4; typedef float Newtype [NO_OF_ROWS] [NO_OF_COLS]; //declares a new data type 1/ which is a 2 dimensional array of floats NewType val; // defines val as a 2 dimensional array of NewType void getData(); //prototype of getData void displayData(NewType array); //prototype of displayData 1/6.3(a) prototype of calculate int main() { getData(); //call getData function and transfer nothing cout> val[row_pos][col_pos] } } displayData(val); //call displayData function and transfer array val } displayData // // task: This function displays all entered inputs // // data in: the array containing val // data returned: none void displayData (NewType array) { for (int row_pos = ; row_pos

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