Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the Passenger data structure we discussed during the last class. Instead of using struct, we will use object-oriented class Create a hierarchy of 3

image text in transcribed

Consider the Passenger data structure we discussed during the last class. Instead of using "struct", we will use object-oriented "class" Create a hierarchy of 3 classes to support "Party", "Person" and "Passenger", where each inherits from its parent. The attributes that define a Party are: -Party Type Code (P'-person,'O' = organization) -Address (one large string) Phone Number (one string) The attributes that define a Person are: - Date of Birth -First Name Last Name The attributes that define a Passenger are: - Ticket Number - Frequent Flyer Number (valid alphanumeric or N/A) - Ticket Price - Flight Number - Seat Location - Flight Date -Status (T = ticketed, 'H, on hold, 'C' = cancel The following functions are to be implemented: (1) Purchase a ticket. This will create a passenger as an inheritance of both person and party. (2) Change a passenger's seat location. Assume that all seats are available. (3) Cancel the ticket. Provide a user interface via Cout and Cin to obtain the information. Print a confirmation when the transaction is complete. Consider the Passenger data structure we discussed during the last class. Instead of using "struct", we will use object-oriented "class" Create a hierarchy of 3 classes to support "Party", "Person" and "Passenger", where each inherits from its parent. The attributes that define a Party are: -Party Type Code (P'-person,'O' = organization) -Address (one large string) Phone Number (one string) The attributes that define a Person are: - Date of Birth -First Name Last Name The attributes that define a Passenger are: - Ticket Number - Frequent Flyer Number (valid alphanumeric or N/A) - Ticket Price - Flight Number - Seat Location - Flight Date -Status (T = ticketed, 'H, on hold, 'C' = cancel The following functions are to be implemented: (1) Purchase a ticket. This will create a passenger as an inheritance of both person and party. (2) Change a passenger's seat location. Assume that all seats are available. (3) Cancel the ticket. Provide a user interface via Cout and Cin to obtain the information. Print a confirmation when the transaction is complete

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

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

5. Understand how cultural values influence conflict behavior.

Answered: 1 week ago

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago