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:

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

Genomes Browsers And Databases Data Mining Tools For Integrated Genomic Databases

Authors: Peter Schattner

1st Edition

0521711320, 978-0521711326

More Books

Students also viewed these Databases questions

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago

Question

Describe the seven standard parts of a letter.

Answered: 1 week ago

Question

Explain how to develop effective Internet-based messages.

Answered: 1 week ago

Question

Identify the advantages and disadvantages of written messages.

Answered: 1 week ago