Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class
ALARM_SIMULATION
feature
check_temperature (temp, threshold: INTEGER)
do
if temp > threshold then
io.put_string("Alarm: Temperature Too High!"); io.put_new_line
else
io.put_string("Temperature Normal"); io.put_new_line
end
end
end
! Run
local
a: ALARM_SIMULATION
do
create a
a.check_temperature(80, 75)
endCoding works best on desktop or with an external keyboard.