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

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

code:

class ElevatorFunctions
{
private:
int no_of_persons;
public:
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;
};

Comments

Sign In or Register to comment.

Howdy, Stranger!

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

Categories

In this Discussion