Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Heres a Java implementation of the Transporter class according ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started