Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * A climber is a person who ascends vertical rocks.
- * The difference between a climber's armspan and their height is called
- * their "apeIndex".
- * @author <YOUR NAME HERE>
- * @version Sep 2013
- */
- public class Climber
- {
- private String name; // the climber's name
- private int apeIndex; // the climber's ape index
- /**
- * Constructor for an empty Climber.
- */
- public Climber()
- {
- this.name = "";
- }
- /**
- * Construct a climber with the given attributes.
- *
- * @param namep the climber's name
- * @param apeIndexp the climber's apeIndex
- */
- public Climber(String namep, int apeIndexp)
- {
- // PROVIDE METHOD BODY HERE
- }
- /**
- * Accessor to climber's name.
- * @return String the name of this climber
- */
- public String getName()
- {
- // PROVIDE METHOD BODY HERE
- }
- /**
- * Accessor to climber's apeIndex.
- * @return int the apeIndex of this climber
- */
- public int getApeIndex()
- {
- // PROVIDE METHOD BODY HERE
- }
- /** Return whether or not this climber has a long reach.
- * @return true if this climber's apeIndex > 2, false otherwise.
- */
- public boolean hasLongReach()
- {
- // PROVIDE METHOD BODY HERE
- }
- /** Return whether or not this climber is empty.
- * @return true if this climber has a name of length zero.
- */
- public boolean isEmpty()
- {
- // PROVIDE METHOD BODY HERE
- }
- /** Determine if two climber's are the same.
- * @param other the climber to whom this climber is compared
- * @return true if climber's are equal
- */
- public boolean equals(Object other)
- {
- if (other instanceof Climber)
- {
- Climber candidate = (Climber) other;
- return this.name == candidate.name;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement