public static void Main()
public Passenger(string Name, double Weight)
System.Console.WriteLine("Whats the Passengers name?");
this.Name = System.Console.ReadLine();
public double GetWeight()
System.Console.WriteLine("what is the Passengers weight?");
this.Weight = double.Parse(System.Console.ReadLine());
private double MaxWeight;
private Passenger[] Occupants;
public Elevator(int maxOccupants, double maxWeight)
this.Occupants = new Passenger[maxOccupants];
this.MaxWeight = maxWeight;
public void AddOccupant(Passenger passenger, int index)
Occupants[index] = passenger;
public double GetCurrentWeight()
double currentWeight = 0;
for (int i=0; i<Occupants.Length; i++)
currentWeight = currentWeight + this.Occupants[i].Weight;
public void IsOverMaxCapacity()
if (currentWeight>this.MaxWeight)