Starting Out With C++ From Control Structures Through Objects
In this video I demonstrate how C++ 2 Dimensional Arrays work, how to manipulate rows and columns of the array, and how to pass 2D arrays into functions as arguments.
Write a program that creates a two dimensional array initialized with test data. Use any data type you wish. The program should have the following:
– getTotal. This function accepts a 2D array and returns total of all the values in the array.
– getAverage. Accepts 2D array, returns average of all values
– getRowTotal. Accepts 2D array, and an integer. The second argument should be the subscript of a row in the array. Returns the total of that row.
– getColumnTotal. Accepts 2D array, and an integer. The second argument should be the subscript of the row in the array. Returns total of that column
– getHighestInRow. Accepts 2D array and integer. Returns highest value in that row.
– getLowestInRow. Accepts 2D array and integer. Returns lowest value in that row
DOWNLOAD SOURCE FILES: yt_2D-Array-Operations