153k views
4 votes
Write the header file Stadium.h for a Stadium class. The Stadium class has the following data members: 1) an array of 1000 Seat objects. 2) stadium name and 3) the number of occupied seats. The Seat is represented as a struct in a seat.h file. The Seat structure has the following data members: 1) Seat Number 2) Customer Full Name and 3) Seat Cost. In addition, provide the following member function prototypes for the Stadium class: Stadium Constuctor: string stadiumName parameter. assignSeat(...): double seatNumber and string customerName parameters, returns nothing unAssignedSeat(...): integer seatNumber parameter, returns nothing getNumberOfAssignedSeats() : no parameters and returns the number of assigned seats. getCostOfSeat(...): double seatNumber parameter and returns the cost of the seat Do not provide the implementation of the member functions.

1 Answer

3 votes

Answer:

Check the explanation

Step-by-step explanation:

File: Seat.h:

typedef struct Seat

{

int seatNumber;

string customerFullName;

double seatCost;

};

File: Stadium.h

class Stadium

{

//Data Members

private:

Seat seats[1000];

string stadiumName;

int numOccupiedSeats;

public:

Stadium(string); //Constructor

void assignSeat(double, string);

void unAssignedSeat(int seatNumber);

int getNumberOfAssignedSeats();

double getCostOfSeat(double seatNumber);

}

User James A Wilson
by
5.1k points