Answer:

Explanation:
Given

------- on or off
Required
Determine the number of codes to be programmed
Since each switch has any of the on or off controls (i.e on or off), then:
The first switch can be coded in any of the 2 controls
The second switch can be coded in any of the 2 controls
The third switch can be coded in any of the 2 controls
Up till the ninth switch
So, we have that:



Hence, there are 512 possible codes