Frame a class Battery with the following:
voltage
threshold
Constructor Battery(int voltage, int threshold)
bool isLow() const
string getStatus() const
The input will contain:
The output should be the battery status: "LOW" or "OK".
LOW
OK
Example Input:
3000 3200
Output:
Here, voltage = 3000 mV, threshold = 3200 mV.Since 3000 < 3200, the battery is low.
Input:
3700 3200
Here, voltage = 3700 mV, threshold = 3200 mV. Since 3700 >= 3200, the battery is fine.
Test Cases
Test Results
Input
Expected Output