I am currently doing a project which consists of a Priority Queue. I have to simulate two boarding procedures of an airline.

Rows 1 through 4 are first class seats (4 seats in each row)
Rows 5 through 26 are coach class seats (6 seats in each row)
Rows 10 and 11 are exit rows.

How do I go about developing this airplane class?? Any suggestions??


Develop an airplane class that contains the following data members:

a) a priority queue where the priority is set using Northwest's previous boarding procedure,

b) a priority queue where the priority is set using Northwest's new random boarding procedure,

c) the amount of time, in seconds, required to board a plane using Northwest's previous boarding procedure, and

d) the amount of time, in seconds, required to board a plane using Northwest's new random boarding procedure.

When using an airplane's previous boarding procedure, general boarding is conducted in the following order:

1) rows 23-26,

2) rows 17-22,

3) rows 11-16, then

4) rows 5-10.

When running the simulation, assume that:

a) A passenger who is not blocked by another passenger requires one second to board.

b) A passenger is blocked when the previous passenger is sitting in the same row or a row closer to the front of the plane. A blocked passenger requires 25 seconds to board.

This is what I have so far:

#include <string>
#include <iostream>
#include "PriorityQueue.h"
#include "Heap.h"
#include "Northwest.h"
#include "Passenger.h"


void Northwest::randomBoarding(void)
{
   rbp.pqInsert( );
}

void Northwest::previousBoarding(void)
{
   if (Rows >= 29 && Rows <= 34)

      setKey(1);

   else if (Rows >= 23 && Rows <= 28)

      setKey(2);

   else if (Rows >= 17 && Rows <= 22) 

      setKey(3);

   else if (Rows >= 11 && Rows <= 16)

      setKey(4);

   else if (Rows >= 5 && Rows <= 10)

      setKey(5);

      pbp.pqInsert( getKey( ));

}


void Northwest::runSimulation(void)
{

}

I guess you have already coded a) previousBoarding now code b,c,d .Should not be difficult homework.

Does the previous boarding look correct? I do I go about doing the runSimulation?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.