You are on page 1of 3

Assignment No.

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.

I. (a). Course Name, Course Code, Section, Semester


II. (b) assignment/test/exam title such as Assignment I or Midterm Exam, Quiz No 1 or Final
Term Exam
III. (c) Number of students in the class,
IV. (d) Each student's name and score on the assignment/test/exam, and
V. (e) The file name for the data to be saved should automatically being decided on the base
of course code, section and semester. In this way a new file shall be created for every test
for every class.
VI. At the start of the program if its new then ask to create the exam otherwise if already
some exams had been taken then program should first display the list of exams already
been taken (based on the exams files already been created at some specified place) and
ask option to show the results of any selected exam or to create a new test.

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)

Course Name: Introduction to object-Oriented Programming with C++


Grading Item: Assignment I
Number of Students: 5

Student Name Student Score Grade


------------------- -------------------- ---------------------
Amir Ikram 80.8 A
Asad Khan 60.4 C
Zaroon Khattak 100.0 A+
Maria Khan 78.9 B+
Tahir Abasi 100.0 A+
------------------- ------------------- --------------------
Class Average: 84.02

Best of Luck

You might also like