ابي احل هذا السؤال ابيه ضروووري
3
) Complete the Exam class below to the following specification:
a) Constructor initialization:
i) Default constructor, to initialize ExamName to Null and No_of_paper to
ii) Parameterized constructor, that initializes all data members to the arguments passed.
b) Class data member validation:
i) Validate ExamType so that it should only be one of the values: Finalterm, Midterm, and Quiz.
ii) Validate No_of_paper so that it should be always greater than or equal to zero.
c) In the Main do the following:
i) Create an object CS140 _Final, CS141 _Final of Exam class, knowing that:
T.Ahmad teaches CS140 and has one Final exam, the number of his students is 41. He also Teaches CS141 and has one final exam, the number of his students is 29.
ii) Create an object CS140 _Quiz, knowing that:
T_Umar is the Teacher assistance of the T_Ahmad's CS140 course, he only has one quiz. (use the Parameterized constructor for initialization).
iii) Create an array of objects CS106 of size 3 knowing that:
T_Umar teaches CS106 and has a 2 Midterms and one Final exam.
iv) Print the exam information of all objects in part ©.
class Exam
{
string ExamType;
string ExamCourse;
int No_of_paper;
public:
void setExamType (string type)
{ ExamType= type;}
void setExamCourse (string course)
{ ExamCourse = course;}
void setpaper(int paper)
{ No_of_paper = paper;}
string getExamType()
{ return ExamType;}
string getExamCourse ()
{ return ExamCourse;}
int getpaper()
{ return No_of_paper;}
};
مشكوووورين :) .
