#include <iostream> using namespace std; class Device { public: int id; }; class Sensor : public Device { public: int value; }; int main() { // your code here: declare Sensor object, assign id and value, and print them Sensor mySensor; mySensor.id = 101; mySensor.value = 75; cout << "Device ID: " << mySensor.id << ", " << "Sensor Value: " << mySensor.value << endl; return 0; }
Test Cases
Test Results
Input
Expected Output
Device ID: 101, Sensor Value: 75