Professional Documents
Culture Documents
#include<stdlib.h>
#include<string>
class CPerson {
private:
string name;
string EGN;
public:
CPerson() : name(""), EGN("") {}
void getData()
{
string c_name = "";
string c_EGN = "";
cout << "Name: "; getline(cin, c_name);
this->Setname(c_name);
cout << "EGN: "; getline(cin, c_EGN);
this->SetEGN(c_EGN);
}
void displayData()
{
cout << "Name: " << this->GetName() << endl;
cout << "EGN: " << this->GetEGN() << endl;
}
string GetName()
{
return this->name;
}
string GetEGN()
{
return this->EGN;
}
void Setname(string c_name)
{
this->name = c_name;
}
void SetEGN(string c_EGN)
{
this->EGN = c_EGN;
}
};
void getData();
void displayData();
};
void Student::getData() {
cout << "facNumber: "; getline(cin, facNumber);
cout << "grades: "; cin >> grades[i];
}
void Student::displayData() {
cout << "facNumber: " << this->GetFacNUmber() << endl;
cout << "grades: " << this->GetGrades() << endl;
}
int main()
{
int cout = 0;
char PR;
do
{
cout << "\n Menu\n";
cout << "1- Student information: \n";
cout << "2- Display student data:\n";
cout << "\n Chose Operation or Cancel by 0\n";
cin >> operation;
switch (operation)
{
case'0':break;
case'1':Profile(cout++).getData() : break;