Question: object oriented programming c++ Modify class Flight such that: 1) It contains an array of 200 passengers. 2) It keeps track of the number of

object oriented programming c++
object oriented programming c++ Modify class Flight such that: 1) It contains
an array of 200 passengers. 2) It keeps track of the number
of reserved seats. 3) It has a method addPassenger, which takes a
passenger as a parameter and reserves a seat for him by adding

Modify class Flight such that: 1) It contains an array of 200 passengers. 2) It keeps track of the number of reserved seats. 3) It has a method addPassenger, which takes a passenger as a parameter and reserves a seat for him by adding him to the array of passengers. 4) It can print the details of all of its passengers. Test your class with a simple driver that defines a flight with 5 passengers and prints the details of the flight and the passengers. \#ifndef FLIGHT_H \#define FLIGHT H \#include using namespace std; class Flight \{ private: static int next_flight_number; const int flight_number ; const string oriin; const string destination; const string departure_date; const string arrival_date; public: Flight(const string\& origin, const string\& destination, const string\& departure_date, const string\& arrival date); void printFlightDetails() const; \}; \#endif \#include int Flight::next_flight_number =1; Flight::Flight(cnst string\& origin, const string\& destination, const string\& departure_date, const string\& arrival_date) : flight_number(next_flight_number++), origin(origin), destination(destination), departure_date (departure_date), arrival_date(rrival_date) {} void Flight::printFlightDetails() const \{ cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!