Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

class Date { public: int day, month, year; Date(int day_, int month_, int year_) : day(day_), month(month_), year(year_){} }; -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- class Time { public: int

image text in transcribed

class Date

{

public:

int day, month, year;

Date(int day_, int month_, int year_) : day(day_), month(month_), year(year_){}

};

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

class Time

{

public:

int hour, minute;

Time(int hour_, int minute_) : hour(hour_), minute(minute_){}

};

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

class Flight

{

private:

string id;

string departurecity;

string arrivalcity;

Date departuredate;

Date arrivaldate;

Time departuretime;

Time arrivaltime;

public:

Flight();

Flight(string p_id, string p_departurecity, string p_arrivalcity, Date p_departuredate, Date p_arrivaldate, Time p_departuretime, Time p_arrivaltime);

string getFlightID();

string getDepartureCity();

string getArrivalCity();

Date getDepartureDate();

Date getArrivalDate();

Time getDepartureTime();

Time getArrivalTime();

void setFlightID(string p_name);

void setDepartureCity(string p_departurecity);

void setArrivalCity(string p_arrivalcity);

void setDepartureDate(Date p_departuredate);

void setArrivalDate(Date p_arrivaldate);

void setDepartureTime(Time p_departuretime);

void setArrivalTime(Time p_arrivaltime);

void print();

~Flight();

};

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

class Passenger

{

private:

int id;//passenger id

string name;

string address;

string telephone;

Date dob;

public:

Passenger();

Passenger(int p_id, string p_name, string p_address, string p_telephone, Date p_dob);

int getId();

string getName();

string getAddress();

string getTelephone();

Date getDob();

void setId(int p_id);

void setName(string p_name);

void setAddress(string p_address);

void setTelephone(string p_telephone);

void setDob(Date p_dob);

void print();

~Passenger();

};

Create a class called Booking that holds booking information when a passenger books a flight. The class should have the following attribute o - Booking number (int) o - Passenger object o - Flight object o - Seat number (string), e.g., C20, A10, etc. The class should have at least the following member functions: One or more constructors Necessary setters and getters A function that prints information about a booking A destructor Deliverables: PROVIDED CLASSES: passenger class, flight class, date class, time class, CLASSES TO MAKE: booking.h, booking.cpp, testbooking.cpp

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

What is a subculture?

Answered: 1 week ago

Question

Recognize traditional approaches to performance appraisals

Answered: 1 week ago