Question: Create a default class named passenger. In this class, create a static variable, called numpassanger, to keep track of the number of passenger objects that
Create a default class named passenger. In this class, create a static variable, called numpassanger, to keep track of the number of passenger objects that have been created. A passenger should include the following attribute : Id : an automatically generated string as the unique identifier of a passanger. Should be generated based on the value of numpassenger. For example, the first passenger object id should be Tickettype: string to represent the type of tickets there are three types od tickets aisle. Middle and widow. Throw illegal argument exception for all values. Price : value, the ticket price should be determinate by ticket type.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
