#include <iostream>
using namespace std;
class Subjects {
void learnToCode() {cout << "Subjects : Learn to Code" << endl;};
void sitForExam() {cout << "Subjects : Sit for Exam" << endl;};
};
class Physics : public Subjects {
void sitForExam() {cout << "Physics: Sit for Exam" << endl;};
void learnRProgram() {cout << "Physics : Learn R Programming" << endl;};
};
class BigData : public Physics {
void learnToCode() {cout << "BigData : Learn to Code" << endl;};
void learnRProgram() {cout << "BigData : Learn R Programming" << endl;};
};
class CloudComputing : public Subjects {
void learnToCode() { cout << "CloudComputing : Learn to Code" << endl;};
void sitForExam() { cout << "CloudComputing : Sit for Exam" << endl;};
};
int main() {
Physics *pilot = new Physics;
BigData *Ben = new BigData;
CloudComputing *Clara = new CloudComputing;
Ben.sitForExam(); /* Physics: Sit for Exam */
Clara.learnToCode(); /* CloudComputing : Learn to Code */
pilot.sitForExam(); /* Physics: Sit for Exam */
Ben.learnToCode(); /* BigData : Learn to Code */
Clara.learnRProgram(); /* Doesn't compile */
pilot.learnRProgram(); /* Physics : Learn R Programming */
return 1;
}