Interview Question
- 0of 0 votes
AnswersUnderstand the Elevator_Operations class definition below and expand the solution:
- mandalikasudhakar March 09, 2014 in India
class Elevator_Operations
{
private:
int number_of_persons;
public:
virtual void move_up() = 0;
virtual void move_down()= 0;
virtual void next_stop() =0;
void set_max_persons(int number_of_persons);
void set_max_weight(float weight_in_kilograms);
int get_current_floor();
int get_next_destination_floor();
virtual void overload_alert(int currentLoad)=0;
};
1) Program must be customizable for different buildings having varying number of floors
2) Method to set the maximum weight and number of persons an elevator can support
3) Method to display alert message when elevator is overloaded, along with the current load
4) At any part of the program current floor and next destination floor details must be made available
5) Code to control the movement of the elevator should be defined only in child class as the working
mechanism varies based on the usage.eg: elevator moves to the very next floor up/down or moves to the
floor which was chosen by the first user, then the next user etc
6) Once destination is reached write a code to open the door; similarly, to close the door after the user
decides
destination floor| Report Duplicate | Flag | PURGE
Coding
Interview Type: Written Test