Class Rover
java.lang.Object
Rover
- public class Rover
- extends Object
Constructor Summary |
Rover(double capacity)
Initialize a new Rover object using the given capacity
in kilograms. |
Method Summary |
boolean |
verifyLoad(ArrayList rocks)
Check that we can in fact take the load of rocks
that has been selected for us. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Rover
public Rover(double capacity)
- Initialize a new Rover object using the given capacity
in kilograms.
- Parameters:
capacity
- the maximum mass this Rover can carry
verifyLoad
public boolean verifyLoad(ArrayList rocks)
- Check that we can in fact take the load of rocks
that has been selected for us.
- Parameters:
rocks
- the ArrayList of Rocks we have been asked to carry
- Returns:
- boolean true if the total mass is less than
or equal to our capacity, false if greater than capacity