#include <iostream>
using namespace std;
class Student{
public:
virtual void getDetails()=0;
virtual void displayDetails()=0;
};
class StudentDetails:public Student{
string fname, mname;
float num;
public:
void getDetails(){
cin >> fname >> mname >> num;
}
void displayDetails(){
cout << fname << endl << mname << endl << num << endl;
}
};
int main() {
StudentDetails sd;
sd.getDetails();
sd.displayDetails();
return 0;
}
using namespace std;
class Student{
public:
virtual void getDetails()=0;
virtual void displayDetails()=0;
};
class StudentDetails:public Student{
string fname, mname;
float num;
public:
void getDetails(){
cin >> fname >> mname >> num;
}
void displayDetails(){
cout << fname << endl << mname << endl << num << endl;
}
};
int main() {
StudentDetails sd;
sd.getDetails();
sd.displayDetails();
return 0;
}
No comments:
Post a Comment