#include <iostream> using namespace std; class Sensor { private: int id{0}; public: Sensor(int arg) { id = arg; std::cout << "Sensor " << id << " initialized" << std::endl; } // your code here: define constructor taking int id and printing "Sensor <id> initialized" }; int main() { Sensor s(101); return 0; }
Test Cases
Test Results
Input
Expected Output
Sensor 101 initialized