Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Car {
- private:
- string model;
- public:
- Car() {}
- Car(string _model) {
- model = _model;
- }
- string get_model() {
- return model;
- }
- void set_model(string s) {
- model = s;
- }
- };
- class SUV : public Car {
- private:
- bool is4x4;
- public:
- SUV(string _model, bool _is4x4) : Car(_model) {
- is4x4 = _is4x4;
- }
- void set4x4(bool b) {
- is4x4 = b;
- }
- bool get_is4x4() {
- return is4x4;
- }
- };
- int main() {
- SUV s("audi", true);
- s.
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement