Question
code in c# This assignment focuses on modeling a given customer or specifically a passenger. For example, the Passenger may be a minor traveling with
code in c#
This assignment focuses on modeling a given customer or specifically a passenger. For example, the Passenger may be a minor traveling with their parents with an assigned seat of F24. Another example of a Passenger is a frequent flyer diamond member with an assigned seat of C3 with a disability.
Design an encapsulated Passenger class. Each Passenger object encapsulates its name, restriction (none, minor, disability, diet), seat, group confirmation number(linked tickets), and contact email. Additionally encapsulates if the Passenger has been checked-in, if the Passenger has boarded. The name is the customer name such as Alan Kay (needed by TSA for airport security). Restriction is information needed to properly assign the seat and avoid health issues during flight. For example, minors and passengers with disabilities must not be seated in the exit row. Seat is the row and letter of the assigned seat. Group is the confirmation number that links passenger traveling together. The email will be used to contact or notify the Passenger.
Note that once a passenger is checked-in their 'checked-in' status can not be undone or the passenger is marked as permanently invalid. Additionally note that once a passenger has boarded their boarded status can not be undone or again the passenger is marked invalid.
You may have additional attributes to your Passenger object to meet the objectives of this assignment. A Passenger can be queried to determine if they are checked in, if they have boarded, if they are invalid, get boarding pass information. possibly other information needed by the driver. Consider carefully what information to provide or not to provide. Do not get carried away with accessors.
Think carefully about what is truly needed. consider what attributes can be manipulated. For example, the passenger name may NOT be changed for security reasons. Additionally once checked-in, manipulation should be further limited.
Document your design decisions. Manipulation should be very limited or restricted completely upon boarding. Please think carefully how to design the attributes of the Passenger. Are you going to allow manipulation? Justify you design choices for your arrangement of the attributes and document in your Programming by Contract. Similarly justify your arrangement of the methods or behaviors of the Passenger class.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started