Assignment 2 OOP
Assignment 2 OOP
2
Object Oriented Programming using C++
Understanding of the question is the part of assignment however you may come to consult me but
after some reasonable study to discuss not just to ask.
Question No1:
Create a class of student capable to store characteristics of student like studentID, studentName,
studentDOB, studentGPA (of last 5 semesters), StudentAddress and other related information of
the student.
i. How many object will be there in your class? It should be user dependent, means run time
will be deciding that how many object will be there in your main client code. So program
should be able to take input of students as per decided numbers from user; definitely
there will be a function which will take input from the user.
ii. Calculate the CGPA of each student using function calculateCGPA(…). The function body
will contain complete method of CGPA calculation.
iii. Student with highest CGPA will be considering CR of the class. There should be a function
which will compare the CGPA of students and will declare a student having greater CGPA
as CR.
iv. getCRName() and getCRID() functions to get name of the CR of the class or to get the ID
of CR.
v. scholorshipAward() function will be there in your class, which will compare CGPA of all
the students and will award scholarship to only those students who have CGPA >=3.0.
vi. getScholorshipHolders() function shall return array of students id of those students id
who are getting scholarship as per given criteria in above point.
vii. You may allow to assign one student record to another student using user defined copy
constructor.
viii. A special function NumberOfObject() will be there in your class which display total
number of declared object in main client, this function must be a static function.
Further, all data members should be private, member functions can be public or private as per
your design decision, getter functions should constant, use separate Setter and Getter for all data
member of the class, you have to use the Setter for setting the values of the data members of
the class and Getter function for getting the values of the data members of the class so getter
function must have appropriate return types and setter function must have appropriate
parameters to set the data members values. Default value for each student GPA should be 0.0.
(You have to use an array for storing GPAs of last 5 semesters. You may simply initialize the array
with 0.0 in constructor).
Note: THERE SHOULD BE 3 FILES; FIRST CONTAINING INTERFACE OF THE CLASS (STUDENT.H),
SECOND CONTAINING IMPLEMENTATION (STUDENT.CPP) AND THIRD CONTAINING THE CLIENT
(THE MAIN FUNCTION).
Question No2:
Being a University teacher I want to develop software which performs the grading task related to
Assignment, Quiz, Mid Term and final Term. I need your help, you are requested to design such
program, which takes information about a test, assignment or exam and save them in a data file.
The first portion of program should ask.
The second portion of program takes exam data from a data file specified by the user and
calculate the class average for that particular test/exam/assignment. The output should be in
the following format. (NOTE: pay attention to the alignment)
Best of Luck