23 lines
360 B
C++
23 lines
360 B
C++
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
class Vehicle {
|
|
public:
|
|
string brand = "Ford";
|
|
void honk() {
|
|
cout << "Honk Honk!";
|
|
}
|
|
};
|
|
|
|
class Car: public Vehicle {
|
|
public:
|
|
string model = "Mustang";
|
|
};
|
|
|
|
int main() {
|
|
Car myCar;
|
|
myCar.honk();
|
|
cout << myCar.brand + " " + myCar.model << "\n";
|
|
return 0;
|
|
} |