Flight Class

Create a Flight class. A flight has an integer number, a string
arrival gate, and an enumerated type for status. The enumerated
type values are for on time, delayed, and cancelled. The
enumeration should be declared in the header file above the Flight
class declaration. There should be accessors for each attribute,
as well as mutators for each. There should be three constructors,
one that just receives a flight number and sets the gate to
unassigned and the status to on time. Another that receives a
flight number and gate and sets the status to on time. Another
that receives and sets all three attributes.

Write a main function that dynamically creates three objects, one
using each constructor, and stores them in an array of Flight
pointers. Then in a loop, print each member using the pointer
operator (the ->). For the status, write a function that prints
each of the three possible values.


#ifndef FLIGHT_H
#define FLIGHT_H

class Flight
{
private:
int number;
string arrivalGate;
enum Status
{
ONTIME;
DELAYED;
CANCELLED;
};
public:
Flight::Flight(int);
Flight::Flight(int, string);
Flight::Flight(int, string, Status);

int getNumber() const;
void setNumber(int);

string getArrivalGate(string);
void setArrivalGate(string)
};
#endif

Done. Now what?
You allready have the class design, you just need to implement those methods of yours
Topic archived. No new replies allowed.