Fall 2022 - CS304P - 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Assignment No.

01 Total Marks: 20
Semester: Fall 2022
Due Date: December
CS3004P- Object Oriented Programming (Practical)
05, 2022

Objective
The objective of this assignment is:
To give you the idea of practical implementation of the following concepts of the Object Oriented Programming
(OOP):
 Access Specifiers, Data Members and Member Functions
 Access Functions
 Default and Parameterized Constructors
 Dynamic Memory allocation using new operator

Uploading instructions:

 Your assignment should be in .CPP format (Any other formats like scan images, PDF, zip, doc, rar and
bmp etc. will not be accepted).
 Save your assignment with your ID (e.g. bc000000000.CPP).
 No assignment will be accepted through email.

Rules for Marking:

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

 The assignment is submitted after due date.


 The submitted assignment does not open, execute or file is corrupted.
 Your assignment is copied from internet, handouts or from any other student.
(Strict disciplinary action will be taken in this case).

Lectures Covered:

This assignment covers Lecture # 7-12.

Assignment No. 01

Virtual University of Pakistan is an institute which offers technical and non-technical courses based on the
distance learning model where one can join any of the courses just by using a computer system. Consider that
you are enrolled in a course, OOP (Object Oriented Programming) and you have been given a task to develop a
program in C++ which will take marks of different assessments as input and displays total marks as an output.
Step by step instructions:
 Write a C++ class name Student with the following attribute: Student Id, Student name, quiz marks (for 4
quizzes), assignment marks (for 2 assignments), Mid Term Marks, Final Term Marks, Total Marks
 Write a parameterized constructor which passes all the data members of the Student class?
 Write an appropriate copy constructor for the student class
 Write member functions for the following requirements:

Function Name Description

enterData() To input data from the user through


console as mentioned in the screenshot.
calculateResult() To calculate the result according to the
grading scheme.
displayData() To print data on the screen as mentioned
in the screenshot.

Grading Scheme:
Number of
Activity Weightage Formulation
activities
Obtained Marks∈all quizzes
Quiz 10% 4 * 10
Total Marks∈all quizzes
Obtained Marks∈all Assignments
Assignment 20% 2 * 20
Total Marks∈all Assignments
Obtained Marks∈ Mid Term
Mid Term Exam 30% 1 * 30
Total Marks∈Mid Term
Obtained Marks∈ Mid Term
Final Term Exam 40% 1 * 40
Total Marks∈Mid Term

Perform the following tasks in main():


o Create an array of size 3 of Student objects using new operator
o Initialize the index [0] using parameterized constructor
o Enter data for the index [1] through enterData()
o Copy index[1] object into index [2] by using copy constructor
o Display all the Records by using displayData()
Note:
Apply all the validations on the marks at the time of input mentioned in the screenshot.
After running your program, the following screen should display.

Best of luck!
NOTE: Do not put any query on MDB about this assignment, if you have any query then email at
[email protected]. Furthermore, if any student found cheating from any other student or from online forums
then he/she will be awarded ZERO right away and strict disciplinary action will be taken against the student.

Deadline: Your assignment must be uploaded/submitted on or before December 05, 2022 .

You might also like