This C++ program illustrates various operations on a multidimensional array and a vector, showcasing fundamental concepts in C++ programming. It demonstrates the principles of object-oriented programming, class design, and array/vector manipulation.
Class Implementation: The program features a class named stuGrade, encapsulating functionality for initializing arrays, vectors, and performing operations on them.
Array and Vector Initialization: It demonstrates how to initialize a two-dimensional array (proj1) and a two-dimensional vector (vec) with data.
Vector Manipulation: The program includes a function to replace specific elements in a vector (replace function) and displays the updated vector.
Sorting: It sorts the elements of the multidimensional array (proj1) in ascending order using the C++ standard library's sort function.
Average Calculation: The program calculates the average of each row in the multidimensional array and stores the results in an array (avgR).
Code Organization: The code is well-structured, with distinct class methods for various operations, enhancing readability and maintainability.
Explore this program to understand how to work with multidimensional data structures, apply object-oriented principles, and perform common array and vector operations in C++.