Assignment 5: Question # 1
Assignment 5: Question # 1
Question # 1:
Create a class called Martix that represents a 3x3 matrix. This matrix contains a two-dimensional
integer array of size 3x3. Provide the following member functions for this class:
a) A one-argument constructor to initialize the member matrix to the matrix sent as an argument
from the calling function.
b) An AddMatrix function for addition of two or more matrice and the result in another array cerated
dynamically in constructor. After addition print the transpose of the matrix.
c) A MultiplyMatrix method for finding the product of the two matrices uaing friend functions.
d) Make a copy constructor for the initialize the obect with another object
Note: Define all the member functions outside the class.
Question # 2:
Calculate the salary of employee on the basis of attendance of employee which you have already compute
in above tasks. Formula to calculate the salary is given below:
Salary = (working-hours per day * total days per month)*1000;
Note: 2 days off per week. Per week total attendance must be 5 of days. And deduct salary on the basis of
absentees.
1000 rupees per absent.