Recall & Review
beginner
What is the main responsibility of the Elevator class in a building system?The Elevator class manages the elevator's current state, including its current floor, direction, and the list of requests it needs to serve.Click to reveal answer
beginner
How does the Floor class typically interact with the Elevator system?The Floor class represents a building floor and can generate requests when a user wants to go up or down, signaling the Elevator system to respond.Click to reveal answer
beginner
What information does a Request class usually contain in an elevator system?A Request class contains details like the source floor, destination floor, and the direction of travel (up or down) to help the elevator decide its movement.Click to reveal answer
intermediate
Why is it important for the Elevator class to maintain a queue of Requests?Maintaining a queue helps the Elevator class efficiently plan stops and serve multiple requests in an organized manner, improving system responsiveness.Click to reveal answer
intermediate
How can the Elevator system decide which request to serve next?
The system can use algorithms like 'nearest floor first' or 'direction-based scheduling' to pick the next request that minimizes travel time and wait time.
Click to reveal answer
Which class is responsible for generating a request when a user presses a button on a floor?
✗ Incorrect
The Floor class generates requests when users press buttons to go up or down.
What key data does a Request class NOT typically include?
✗ Incorrect
User's name is not usually part of the Request class; it focuses on floors and direction.
Why does the Elevator class keep track of its current floor?
✗ Incorrect
Knowing the current floor helps the elevator decide which requests to serve next.
Which scheduling strategy helps an elevator serve requests efficiently?
✗ Incorrect
Nearest floor first reduces travel time and wait time.
What does the Floor class represent in the elevator system?
✗ Incorrect
The Floor class models a building level where users can request elevators.
Explain the roles of Elevator, Floor, and Request classes in an elevator system.
Think about how a person calls and uses an elevator.
You got /3 concepts.
Describe how an elevator system decides which request to serve next and why this is important.
Consider how elevators avoid unnecessary travel.
You got /3 concepts.
