Answered step by step
Verified Expert Solution
Link Copied!

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming Logic & Design Comprehensive

Authors: Joyce Farrell

9th edition

978-1337102070

More Books

Students also viewed these Programming questions

Question

What are the 5 Cs of marketing channel structure?

Answered: 1 week ago

Question

6. What is the function of Golgi tendon organs?

Answered: 1 week ago