<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/** Diver: A SCUBA diver may be "wet", "dry", or "bent", has a lung
 *  capacity, a tank capacity, a depth, and a name.
 */
public class Diver {

  /** The depth of the diver, in meters
   */
  private int depth;

  /** Is this diver "wet", "dry", or "bent"?  If "dry" then
   *  depth is 0 and tankCapacity may be ignored.  If "bent" then
   *  tankCapacity may be ignored, and depth is recorded to
   *  aid in medical treatment.
   */
  private String status = "dry";

  /** How big (in liters) is this divers vital lung capacity?
   */
  private int lungCapacity;

  /** How big (in liters) is this diver's tank?
   */
  private int tankCapacity;


  /** Set this diver's name to n
   */
  public void setName(String n){
    name = n;
  }

  //-----------------------------------------------------------------
  // Fill in the missing pieces between the dotted lines

  /** Declare a variable for this diver's name. */

  /** Make this diver "wet", put them at depth d. */

  /** Make this diver have lung capacity lc */

  /** Make this diver have tank capacity tc */

  /** Change the depth of this diver by amount a. */

  /** Make this diver "dry", make their depth 0. */

  /** Make this diver "bent". */

  /** Return the depth of this diver */

  /** Return the tank capacity of this diver */

  /** Return the lung capacity of this diver */

  //-----------------------------------------------------------------
  // Don't change code below this line!

  /** Return a String representation of this Diver.
   *  108 Students: Do not change this method!
   */
  public String toString() {
    String result = "Diver " + name;
    result += "\nstatus: " + status;
    result += "\nlung capacity: " + lungCapacity;
    result += "\ndepth: " + depth;
    
    if (status.equals("wet")) {
      result += "\ntank capacity: " + tankCapacity;
    }
    else if (status.equals("bent")) {
      result += "\nEMERGENCY: get to a hyperbaric chamber!";
    }

    return result;
  }
}

  


</pre></body></html>