/****************************************************************************************** ex4.cpp rewriting an existing OOP class ******************************************************************************************/ #include <iostream> #include <string> using namespace std; //class definition class name { public: string first; string last; int age; }; void main() { name father; father.first = "Doug"; father.last = "Trebbin"; father.age = 45; cout << "Father: " << father.first << ' ' << father.last << endl << "Aged " << father.age << " years." << endl; name junior; junior.first = father.first; junior.last = father.last; junior.age = 15; cout << "Junior: " << junior.first << ' ' << junior.last << endl << "Aged " << junior.age << " years." << endl; return; }