**Assignment No. 2**

**Semester: Spring 2021**

**CS201 – Introduction to Programming**

**Total Marks: 20**

**Due Date: **

**8 ^{th}
June 2021**

__Instructions__

**Please read the following instructions carefully before submitting
assignment:**

**It should be
clear that your assignment will not get any credit if:**

** **

o
*Assignment is
submitted after due date.*

o
*Submitted assignment
does not open or file is corrupt.*

o
*Assignment is copied
(From internet/students). *

* *

__Software allowed to develop Assignment__

**Dev C++**

*Objectives:*

*In this assignment, the students will learn:*

*How to fill a two-dimensional array using given data.**How to write user defined functions and pass an array to them as parameter.**How to use if statement and while loop.**How to display array elements.*

* *

__Assignment Submission Instructions __

You are required to submit only **.cpp** file on the assignments interface of CS201 at VU-LMS. *Assignment submitted in any other format
will not be accepted and will be graded zero marks.** So, check your solution file format before submission. *

__ __

For any query related to
assignment, please contact cs201@vu.edu.pk.

**
Lectures: 7 to 15**

__Problem Statement__

A matrix is
given in source data. You have to write user defined functions and create a
menu in C++ keeping in mind the following requirements:

- Press
1 to display the matrix and its transpose.

(Hint: Transpose of a
matrix can be achieved by changing its rows into columns or columns into rows.)

- Press
2 to find adjoint and determinant of the matrix.

(Hint: To find adjoint
of a matrix, we change the places of its diagonal elements and the signs of
non-diagonal elements; To find determinant of matrix, we subtract the product
of non-diagonal elements from the product of diagonal elements.)

- Press
any other key to exit.

__ __

__Source data: __

(Use
two dimensional array to store following matrix)

__ __

__Instructions
to write C++ program:__

** **

Ã˜
Write functions to display the matrix; find
transpose, adjoint and determinant of the matrix. Following function names
should be used for consistency.

To display matrix |
showMatrix( ); |

To show transpose |
showTranspose ( ); |

To show adjoint |
showAdjoint(); |

To find determinant |
calculateDeterminant(); |

*DOWNLOAD*

*DOWNLOAD*

Sample Output:

1)
When 1 is pressed

1)
When 2 is pressed

1)
When any other key is pressed

*Lectures Covered: **This assignment
covers Lecture #** **07-15**.*

*Deadline:
**The
deadline to submit your assignment solution is **8 ^{th}
June 2021*

*. Your assignment must be submitted within the due date through VU-LMS. No assignment will be accepted through email after the due date.*

## Post a Comment

Don't Forget To Join My FB Group VU Vicky

THANK YOU :)