How to design and implement the elevator simulation in C++ - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to design and implement the elevator simulation in C++

mandalikasudhakarmandalikasudhakar IndiaPosts: 2Member

Hi All,

Could you please let me know how to design and implement the following in C++/VC++/MFC
ElevatorFunctions class below :

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 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


class ElevatorFunctions
int no_of_persons;
virtual void moveUp() = 0;
virtual void moveDown()= 0;
virtual void nextStop() =0;
void setmax_persons(int no_of_persons);
void setmax_weight(float weight_in_kg);
int getcurrent_floor();
int getnext_destination_floor();
virtual void overload_alert(int currentLoad)=0;
Sign In or Register to comment.