Assignment 2
Assignment 2
Assignment 2
Question No 6: Write a program having 7 data member all of different data types, use
constructor 2 constructor with 3 and 4 argument to initialize the data member.(initialize the data
member during object creation ) Provide values to constructor during compilation time.
Question No 7: Re-write the Question No 6, by this time provide values to the constructor
during run time, and i.e. pass variables instead of constant values. (Take value from user inside
the main function).
Question No8:
Create a class of student which stores characteristics of student like studentID, studentName,
studentDOB, studentGPA, StudentAddress of last 5 semesters and other related information of
the student.
a. How many object will be there in your class? It should be user dependent, means run time
will be decide that how many object will be there in your main client code.
b. Calculate the CGPA of each student using function calculateCGPA(). The function body
will contain complete method of CGPA calculation.
c. 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.
d. 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.
e. Program should be able to take input of 5 students from user; definitely there will be a
function which will take input from the user.
f. 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.
g. Default value for each student GPA should be 3.0. (You have to use an array for storing
GPAs of last 5 semesters. You may simply initialize the array with 3.0 in constructor).
h. Assign one student record to another student using user defined copy constructor.
i. 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.
j. All data members should be private.
k. Member functions can be public.
l. Setter factions should also be private.
m. Use separate Setter and Getter for data member of the class.
Note: THERE SHOULD BE 3 FILES; FIRST CONTAINING INTERFACE OF THE CLASS (STUDENT.H),
SECOND CONTAINING IMPLEMENTATION (STUDENT.CPP) AND THIRD CONTAINING THE CLIENT
(MAIN FUNCTION).
Question No10: (understanding of the question is part of assignment)
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.
Best of Luck