0

Can someone please make a lamp algorithm as an example?

The lamp is broken. It is also plugged in and the bulb is not burnt out. If it is not plugged in, then plug it in. Else, If the bulb is burnt out, then replace it. Else, Repair lamp.

6th Apr 2017, 7:20 PM
Scrambles
1 ответ
+ 18
You have 3 booleans there: broken = True pluggedIn = True burntout = False Now you need to implement the if-elif-else
6th Apr 2017, 7:25 PM
Jafca
Jafca - avatar