Question: Write the main method to run each method with the provided test case. ( 5 pts ) Below this Yourlastname _ Yourfirstname _ final class,
Write the main method to run each method with the provided test case. pts
Below this YourlastnameYourfirstnamefinal class, create a default class named Passenger. pts
In this class, create a static variable, called numPassenger, to keep track of the number of Passenger
objects that have been created.
A passenger object should include the following attributes:
id: an automatically generated string as the unique identifier of a passenger. Should be generated
based on the value of numPassenger. For example, the first passenger object's id should be
ticketType: a string to represent the type of tickets. There are three types of tickets: "aisle", "middle",
and "window". Throw IllegalArgumentException for all other values.
price: double, the ticket price should be determined by ticketType:
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
