Professional Documents
Culture Documents
2 Total Marks: 20
Semester: Fall 2023 Due Date: Jan
CS201P – Introduction to Programming (Practical) 11, 2024
Instructions
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
- Dev C++
Objectives:
To enable students to understand and practice the concepts of:
Arrays
Pointers and its arithmetic.
Function and passing arrays or pointers as arguments to a function.
You are required to submit only .cpp file on the assignments interface of CS201P 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 cs201p@vu.edu.pk.
For all matrices A=[ aij ] of order m x n. where i =1…m and j =1…n
You have to write a program in C++ which will perform the tasks mentioned in the problem statement.
For this purpose take:
A function AddMatrix () which should take two matrices (arrays) and add them.
A function MultMatrixByScalar () which should take an integer and a matrix (array) and multiply them.
Add the TWO matrices A and the resultant matrix (2*B) using function AddMatrix.
matrices A and B.
2*B matrix.
the Final resultant matrix [A + 2*B].
Hint:
Two matrices are added by adding their corresponding elements.
A scalar K can be multiplied with a matrix as:
Kx [ ac bd ]=[ KK ac KK db]
For consistency of the assignment, please only use the above given matrices (arrays).
Note: Marks will be deducted if the given arrays are not used.
Good Luck!