You are on page 1of 2

SSN COLLEGE OF ENGINEERING, KALAVAKKAM DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Object Oriented Programming Lab CS2209 Programming

g Assignment-3 Matrix and Complex operations using Dynamic allocation, constructor and destructor ---------------------------------------------------------------Date: 05.08.2013 Due Date: 12.08.13, 13.08.13 & 16.08.13 1. Design a class for matrix with a integer double pointer, row and column. Write methods read, write, add, copy constructor and destructor.

Read() Reads the matrix of the desired order Write() Used to print the matrix (in matrix format itself) Add() Used to add the given two matrices. Copy constructor is used to copy the value of one matrix to the other. Destructor is used to free the memory of the matrix object

Write a program to demonstrate the working of matrix class with suitable inputs desired by the user. (Implement using do while)

2. Design a class for complex number with integer data members such as real and imaginary. Write operator functions +, _, *, % to perform addition, subtraction, multiplication and division of complex numbers. Overload the stream operators to read and write the complex numbers. Operator function (+) - Used to add two complex numbers Operator function (-) - Used to subtract two complex numbers Operator function (*) - Used to multiply two complex numbers Operator function (%) - Used to divide two complex numbers Operator function (>>) Used to read the complex number Operator function (<<) Used to write the complex number

Write a program to demonstrate the working of complex class with suitable inputs desired by the user. (Implement using do while)

You might also like