Answered step by step
Verified Expert Solution
Link Copied!

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. (5 pts)
Below this Yourlastname_Yourfirstname_final class, create a default class named Passenger. (15 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 "1".
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: ticket type : isle middle

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

More Books

Students also viewed these Databases questions

Question

Identify the amount and timing of cash flows. LO3

Answered: 1 week ago

Question

sharing of non-material benefits such as time and affection;

Answered: 1 week ago