Question: De Morgan's theorem in programming Jamie is making a robot vacuum cleaner. The robot has three sensors to detect if the robot is located on
De Morgan's theorem in programming Jamie is making a robot vacuum cleaner. The robot has three sensors to detect if the robot is located on the charging station or not. A sensor retuins true if the sensor is over the station and false when the sensor is outside the station. Jamie is working on piece of code that is supposed to drive the robot out of the charging station. Jamie has three variables that represent the state of the sensors: L is for the left side of the robot, C is for the center, and R is for the right side of the robot. Jamie has written an if-statement to run the robot at full speed when it has completely left the charging station: if not (not L or not C or not R ) : full_speed () Use De Morgan's theorem to simplify Jamie's stop condition. Is Jamie's if-statement correct
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
