Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

this is my elevator header code. please write all comment about this code... #pr

ID: 3837773 • Letter: T

Question

this is my elevator header code. please write all comment about this code...

#pragma once #include #include #include #include #include class Elevator { friend class People; private: int people; int current_floor; int states; std::vector elevator_stops; int max_people = 3; int displacement; std:¡string elevator_ID; public Elevator(); Elevator(std::string ID, int current); void updating2(std::vector myvector. People p1, Elevator& e2, Elevator& e3); void find_displacement(People p1); void goingup(); void goingdown(); void arrival(); void destination(); void action();

Explanation / Answer

# pragma once

#include <iostream>
#include <vector>
#include <string>
# include <math.h>
#include <People.h>

class Elevator {
   // adding people class as friend so that people can use elevator class method without veryone creating their own elevator
   friend class People;
private:
   // count of number of people in elevator
   int people;
  
   // floor number on which elevator is in currently
   int current_floor;
  
   // state number of elevatpr;
   int states;
  
   // vetcor of elevator stops a list of string int pair
   std::vector<std::pair<std::string, int>> elevator_stops;
  
   // Elevator capacity
   int max_people = 3;
  
   // displacement from next stop;
   int displacement;
  
   // unique identfier for elevator
   std::string elevator_ID;

public:
   // default constructor
   Elevator();
  
   // constructir with elevator id and its current floor
   Elevator(std::string ID, int current);
  
   // updatnig current stop of elevator and number of people and updating this to other elevators also
   void updating2(std::vector<std::pair<std::string, int>> myvector, People p1, Elevator& e2, Elevator& e3);
  
   // find displacement of person and elevator
   void find_displacement(PEople p1);
  
   // Go up
   void goindup();
  
   // go down
   void goingdown();
  
   // arrival floor;
   void arrival()
  
   // destination floor;
   void destination();
  
   // action of goind up or down on which floor
   void action();
};