Working with Classes
Classes are a fundamental building block of object-oriented programming. They allow you to encapsulate data and behavior into a single unit, making your code more modular and easier to maintain. In this lab, you will learn how to work with classes in C++.
Table Class
In this lab, you will implement a class for a table
The table class should have the following methods:
- Constructor: The constructor should take the number of rows and columns as arguments and initialize the table with the given number of rows and columns.
- Get: The get method should take the row and column index as arguments and return the element at the given row and column index.
- Set: The set method should take the row and column index and the value as arguments and set the element at the given row and column index to the given value.
- Print: The print method should print the table to the console.
- Rondom fill: The random fill method should fill the table with random values.
Click on the links below to view the code for the table class: