All submissions
#include <iostream>
using namespace std;

// Define the Sensor class
class Sensor {
private:
    int value;  // private variable

public:
    // Method to set value
    void setValue(int v) {
        value = v;
    }

    // Method to get value
    int getValue() {
        return value;
    }
};

int main() {
    Sensor s;         // Create Sensor object
    s.setValue(75);   // Set value to 75
    cout << "Sensor value: " << s.getValue() << endl; // Print the value
    return 0;
}
Loading...

Input

Expected Output

Sensor value: 75