#include <iostream> using namespace std; class Vehicle { public: // your code here: implement void printCategory() to print "Generic Vehicle" void printCategory() { std::cout<<"Generic Vehicle"<<std::endl; } }; // your code here: define class Car inheriting publicly from Vehicle // implement void printCar() to print "Car Vehicle" class Car : public Vehicle { public: void printCar() { std::cout<<"Car Vehicle"<<std::endl; } }; int main() { Car c; c.printCategory(); // inherited method c.printCar(); // derived method return 0; }
Test Cases
Test Results
Input
Expected Output
Generic Vehicle Car Vehicle