What does 'object composition' mean?
- A.Writing all your code in one giant class
- B.One class storing an instance of another class and using it
- C.Two classes with the same methods
- D.Turning a function into a class
Answer Why?
Why is there a time.sleep(0.5) at the start of turn_right(), before the while loop?
- A.To let the motors warm up
- B.So the robot rotates off the cross first — otherwise the sensor is still on the line and the turn ends immediately
- C.To slow the whole program down
- D.It is required by every method
Answer Why?
What does the `pass` inside the while loop do?
- A.Stops the loop
- B.Nothing — the loop just keeps re-checking the condition while the motors spin
- C.Passes control to another method
- D.Reads the sensor
Answer Why?
Why can the main program be just a few method calls now?
- A.The robot got faster
- B.All the sensor and motor detail is hidden inside the classes
- C.Classes make code run with fewer steps
- D.It skips the control loop
Answer Why?