#include #include using namespace std; class Vehicle { private: string name; string sound; public: Vehicle(const string& init_name, const string& init_sound) : name {init_name}, sound {init_sound} {} void honk() const { cout << "The " << name << " goes " << sound << "!\n"; } void funFact() const { if (name == "car") { cout << "Fun fact: The world's first speeding ticket was issued in 1902!\n"; } else if (name == "motorcycle") { cout << "Fun fact: The first motorcycle was invented in 1885!\n"; } else { cout << "Fun fact: Vehicles have transformed human transportation!\n"; } } }; int main() { Vehicle car {"car", "beep beep"}; Vehicle motorcycle {"motorcycle", "vroom vroom"}; car.honk(); car.funFact(); motorcycle.honk(); motorcycle.funFact(); return EXIT_SUCCESS; }