Create a program that lets you board people in an airplane. We’ve already prepared some things for you here so you don’t have to build everything from scratch. You are supposed to build the class Airplane.
The following rules apply for this program:
Airplane, but may not be changed after creating an Airplane instance.Bag instances) that must also be carried on the plane. Each passenger takes 0-3 bags in which this weight is distributed. It is important that the plane does not exceed the maximum weight (what it can carry). This maximum is 25 kg * the number of passengers that fits in the plane. (So with 40 passengers on the plane, a maximum of 1000 kg of luggage can be carried).Now write the full implementation of the program, focusing on adding the following functionality:
lockDoors()) and open (unlockDoors()) the doors of an aircraft. Also, you should be able to query whether the doors are locked or not (hasLockedDoors())boardPassenger(Passenger passenger) that allows you to seat a particular passenger on the plane.
IllegalStateException should be thrown.
depart() that allows you to make the plane leave.
You may use the code that you wrote before, but we have an example solution available.
Note: When you choose to use the example solution, you may only write unittests. The solution is perfect.
The code may still contains the original tests written in Java. The example certainly does. Feel free to use this as inspiration for your unittests.
A small sample of tests is written for the Bag class. It is your task to write a test class for Passenger and Airplane.
You are done when you have achieved 100% coverage.
