· class Shuttle should include:
· suitable fields as specified above. The "from" planet and the "to" planet should be Planet objects
· a small range of accessors/mutators to process data held by the class
· method which returns a boolean saying whether a permit given as a parameter can enter the shuttle
· a method to process a permit moving to the destination planet;
o if the permit meets the conditions, remove it from the source planet, add it to the destination planet, update information on the permit, and return a suitable message
o if it does not meet one of the conditions, return an appropriate message and do NOT move it
· a method toString()which returns a String representation of an object of that class (no need to list all of the planet details, just the planet numbers and names)
t
Comments
Leave a comment