Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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