/* 30th Oct 2014 TASK: Combine the two codes task_mat_pointer.cpp and task_mat_pointer.cpp in the following manner: introduce another public member function 'Fill_matrix()' and'Print_matrix()' which randomly fills the matrix and prints the entries of the matrices respectively. */ #include #include using namespace std ; class Matrix { double ** value; int n; //private member variables only to be accessed by the 'public' members of the class. public: Matrix(int _n) //constructor { n =_n ; } ~Matrix() //destructor { } void Print() { cout << "This is a matrix which is of size = " << n << endl ; } void Fill_matrix() { cout << "We fill the matrix " << endl; } void Print_matrix() { cout << "We print the filled Matrix" << endl; } }; //class declaration end. // usage of the class int main() { int n = 0; //initializer for the integer cout << "Enter n: "; cin >> n ; cout << "You entered: "<< n << endl; Matrix m(n); m.Print(); m.Fill_matrix(); m.Print_matrix(); return 0; }