125k views
4 votes
Which of the following could NOT be represented by a boolean variable?

Whether a moving elevator is moving up or down

Whether a traffic light is green, yellow or red

Whether a store is open or closed

Whether a light-bulb is on or off

User Iacob
by
4.3k points

1 Answer

5 votes

Answer:

Whether a traffic light is green, yellow or red

Step-by-step explanation:

Boolean variables are variables that can either take one out of two options at any given instance.

Analyzing the given options

1. Elevator:

Possible Directions = Up or Down; That's two possible values

But it can only move in one direction at a given instance.

This can be represented using Boolean

2. Traffic Light:

Possible Lights = Green, Yellow or Red

That's three options.

This can be represented using Boolean

The last two options can be represented using Boolean because they have just two possible values

Hence, option (B) answers the question

User Floyd
by
4.1k points