Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions

Question

b. Why were these values considered important?

Answered: 1 week ago