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

1 Expert Approved Answer
Step: 1 Unlock

Heres a Java implementation of the Transporter class according ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!