write the class graduating student as a subclass of the student class
#include <iostream>
using namespace std;
class Student
{
public:
Student(){}
Student(string firstName, string lastName)
{
this->FirstName = firstName;
this->LastName = lastName;
}
void setFirstName(string name)
{
this->FirstName = name;
}
void setLastName(string name)
{
this->LastName = name;
}
void setCource(string cource)
{
this->Cource = cource;
}
void setUnivercityYear(int univercityYear)
{
this->UniversityYear = univercityYear;
}
string getFirstName()
{
return this->FirstName;
}
string getLastName()
{
return this->LastName;
}
string getCource()
{
return this->Cource;
}
int getUnivercityYear()
{
return this->UniversityYear;
}
private:
string FirstName;
string LastName;
string Cource;
int UniversityYear;
};
class GraduatingStudent : Student
{
public:
GraduatingStudent(Student student)
{
this->Student = student;
}
void setQualificationWork(string cvalificationWork)
{
this->QualificationWork = cvalificationWork;
}
void setIDDiploma(int id)
{
cout << "You have successfully completed your studies";
this->IDDiploma = id;
}
string getQualificationWork()
{
return this->QualificationWork;
}
int getIDDiploma() {
return this->IDDiploma;
}
private:
string QualificationWork;
int IDDiploma;
Student Student;
};
Comments
Thank you for helping me
Leave a comment