#include <iostream> class Device { public: // your code here: implement void printType() to print "Generic Device" void printType(void); }; void Device::printType(void){ std::cout << "Generic Device" << std::endl; } class Sensor : public Device{ public: void printSensor(void); }; void Sensor::printSensor(void){ std::cout << "Sensor Device" << std::endl; } int main() { Sensor s; s.printType(); // inherited method s.printSensor(); // derived method return 0; }
Test Cases
Test Results
Input
Expected Output
Generic Device Sensor Device