#include <iostream> using namespace std; class Device { public: int id; void assignID(int n){ id =n; } void printDevice(){ cout << "Device ID: " << id << endl; } }; int main() { // your code here: declare Device object, assign id, and print it Device d; int n = 101; d.assignID(n); d.printDevice(); return 0; }
Test Cases
Test Results
Input
Expected Output
Device ID: 101