You are on page 1of 3

BSE201052

Hamza Tarazi
OOP
16 December 2020
Ma’am Faria
Assignment 3

#include<iostream>
using namespace std;
class Final_Evaluation
{
protected:

//Data Members
int Registration_number;
string Name;
float cgpa;
int credit_hour;

public:
//Default constructor for initialization
Final_Evaluation() :Registration_number(),Name(),cgpa(),credit_hour(){}

//Methods
//Default Function
void Evaluation()
{
cout << "Yet to be Evaluated!!!!" << endl;
}

//Parametrized Function
virtual void Evaluation(int r, string N, float cg, int c)
{
this->Registration_number = r;
this->Name = N;
this->cgpa = cg;
this->credit_hour = c;
}
};
class BS : public Final_Evaluation
{
public:

//Parametrized Function
void Evaluation(int r, string N, float f, int c)
{
this->Registration_number = r;
this->Name = N;
this->cgpa = f;
this->credit_hour = c;
cout << "Registration Number of Student is :: " << Registration_number << endl;
cout << "Name of Student is :: " << Name << endl;
cout << "CGPA of student is :: " << cgpa << endl;
cout << "Credit hous of course is :: " << credit_hour << endl;

if (credit_hour > 123)


{
cout << "Proceed to FYP || evaluation ||" << endl;
}
else if (credit_hour > 116 || credit_hour < 123)
{
cout << "Proceed to FYP | evaluation ||" << endl;
}
else if (credit_hour < 116)
{
cout << "Appropiate Message" << endl;
}
}
};
class MS : public Final_Evaluation
{
public:
//Parametrized Function
void Evaluation(int r, string N, float f, int c)
{

this->Registration_number = r;
this->Name = N;
this->cgpa = f;
this->credit_hour = c;

cout << "Registration Number of Student is :: " << Registration_number << endl;
cout << "Name of Student is :: " << Name << endl;
cout << "CGPA of student is :: " << cgpa << endl;
cout << "Credit hous of course is :: " << credit_hour<<endl;

if (credit_hour > 123)


{
cout << "Proceed to Thesis || evaluation ||" << endl;
}
else if (credit_hour > 116 || credit_hour < 123)
{
cout << "Proceed to Thesis | evaluation ||" << endl;
}
else if (credit_hour < 116)
{
cout << "Appropiate Message" << endl;
}
}
};
int main()
{
//Parent Class object
Final_Evaluation* obj,*obj2;

//Derived class obj


BS bs;
//stores the address of BS
obj = &bs;
cout << "BS STUDENT\n";
cout << "==========================================\n";
obj->Evaluation(1234, "Hamza", 3.04, 125);
cout << "==========================================\n";
//Derived Class object
MS ms;
//stores the address of MS
obj2 = &ms;
cout << "MS STUDENT\n";
cout << "==========================================\n";
obj2->Evaluation(120, "ALI", 2.09, 114);
cout << "==========================================\n";

You might also like