i an writing a room class java code that returns the temperature status of the room and return if a lightbulb is on or off.
how do i write the method for the temperature?
public class SittingRoom {
String SRlightBulb;
int SRTemperature;
public SittingRoom()
{String InitialStatus = null;int InitialTemp;
SRlightBulb = InitialStatus;
SRTemperature = InitialTemp;
}
void switchLightOn()
{
SRlightBulb = "ON";
}
void switchLightOff()
{
SRlightBulb = "OFF";
}
public String checkSRLightBulbStatus()
{
return SRlightBulb;
}
public int checkTemperature()
{
return SRTemperature;
}
public static void main (String [] arg)
{
SittingRoom n = new SittingRoom();
System.out.println(n.checkTemperature());
}
}