#include #include using namespace std; // change struct to class - same result struct employee{ int age; string name; employee(){} employee(string n, int a){name = n;age = a;} void print(){cout << name << " " << age << endl;} }; class car{ private: string engine; int horse_power; int doors; public: car(); void print(); // mutator for changing hp void setHP(const int h){ doors = 3;// allowed horse_power = h;} // accessor for getting current HP int getHP(void)const{ //doors = 42; //engine = "V16"; return horse_power; } }; void main(){ // test structs and objects employee fred("Harry",13), wilma; car race; race.print(); // not allowed //race.horse_power = 2700; race.setHP(3500); cout << "modified HP " << race.getHP() << endl; race.print(); wilma.name = "Wilma"; wilma.age = 45; fred.print(); wilma.print(); }; car::car():engine("4cyl"),horse_power(145),doors(2){}; void car::print(){cout << engine << " " << horse_power<