Question: Create a class called Transporter that has the following attributes: Transporter cargoCapacity - Double personelleCapacity - Integer cargo[][] - String personelle[] - String Transporter ()
Create a class called Transporter that has the following attributes:
| Transporter |
| cargoCapacity - Double |
| personelleCapacity - Integer |
| cargo[][] - String |
| personelle[] - String |
| Transporter () |
| Transporter (cargoCapacity, personelleCapacity) |
| addCargo(String, double) - Boolean |
| removeCargo(String) - Boolean |
| addPersonelle(String) - Boolean |
| removePersonelle(String) - Boolean |
| toString() - String |
Note:
Cargo is a 2-dimensional array of Strings where it stores the name of the item and also the weight. Because we are storing the weight as a String you will have to convert this data to a double to check the weight. Return true if the cargo item can be added and results in the weight of all cargo being under the cargoCapacity. Return false if adding the item would cause us to exceed the cargoCapacity.
Step by Step Solution
There are 3 Steps involved in it
Heres a Java implementation of the Transporter class according ... View full answer
Get step-by-step solutions from verified subject matter experts
