·
· class Planet should include:
· suitable fields as specified above.
· a constructor to create a planet using suitable parameters
· accessors to return its planet number, name, luxury rating
· an ArrayList field to store Permit object references.. (declared and created)
· mutator ; enter()which has a Permit as a parameter and adds it from the ArrayList
· mutator leave()which has a Permit as a parameter, finds its position in the ArrayList and then removes using position.
· an accessor which either says whether the planet is full (reached capacity) (..or still has capacity)
· method to list all the Permits currently on the planet
· methods to find and return details of one Permit on the planet
· an accessor which returns a boolean saying whether a Permit is in the planet (in the ArrayList)
· a toString () method which includes planet details and a list of the Permits in the planet
Comments
Leave a comment