#include <iostream> using namespace std; class Sensor { public: void readValue(){printf("Reading sensor value\n");} }; class Logger { public: void logData(){printf("Logging data\n");} }; // your code here: define class SmartSensor inheriting publicly from Sensor and Logger // implement process() to call both readValue() and logData() class SmartSensor : public Sensor,public Logger{ public: void process(){ readValue(); logData(); } }; int main() { SmartSensor ss; ss.process(); return 0; }
Test Cases
Test Results
Input
Expected Output
Reading sensor value Logging data