Write a Java class SpiceJetPlane. A SpiceJetPlane object has a flight number, name of the captain, all PNR numbers of passengers and total capacity of the plane.
a) Write a default constructor that initializes the SpiceJetPlane object using following default values: flight number as “Not Assigned ”, name of the captain as “Not Assigned”, total capacity to 0 and PNR number to “X00X0X”.
b) Write a parameterized constructor that initializes each field of the SpiceJetPlane object.
c) Override equals method such that two flights with same flight number are considered equal.
d) Override toString method to print the SpiceJetPlane object in the following style.
Flight Number : <flight number>
Captain’s Name: <captain name>
Total Capacity: <capacity>
Passenger Boarded:
PNR NO: X12Q0Y
PNR NO: X14Q5A
PNR NO: X36Q7Z
PNR NO: X28A4U
PNR NO: X11E1K
Answers
Answered by
0
Sorry! I can't.. you Lulu vs setup cm
Similar questions
Political Science,
1 month ago
English,
1 month ago
Computer Science,
1 month ago
Math,
3 months ago
Math,
3 months ago
Science,
10 months ago