/** A musician in a band. */
public class Musician {
  
  /** The name of the musician. */
  private String name;
  
  /** The hourly salary of the musician. */
  private double salary;
  
  /** The number of bands the musician has joined. */
  private int numBands;
  
  /** The total number of musicians on the planet. */
  public static int totalNumMusicians; // can be private or public!
  
  /**
   * Create a new musician with name n and
   * salary s.
   */
  public Musician(String n, double s) {
    this.name = n;
    this.salary = s;
    totalNumMusicians++; // update the static variable here
  }
  
  /**
   * Get the hourly salary for this musician.
   */
  public double getSalary() {
    return this.salary;
  }  
  
  /**
   * Return the number of bands this musician has joined.
   */
  public int getNumBands() {
    return this.numBands;
  }
  
  /**
   * Musician has joined a band.
   */
  public void joinedBand() {
    this.numBands++;
  }
  
  /**
   * Set this musician's salary to s.
   */
  public void setSalary(double s) {
    this.salary = s;
  }

  /**
   * Get the name of this musician.
   */
  public String getName() {
    return this.name;
  }  
  
  /**
   * Get the String representation of this musician.
   * Note: this does NOT print/display the string.
   *       it just *returns* the string.
   */
  
  public String toString() {
    return "Name: " + this.name + ", Salary: " + this.salary; 
   
  }
  
  /** 
   * returns true if m2 is equal to this musician where
   * by equal we mean having the same name.
   */  
  public boolean isEqual(Musician m2){
    //note: string equality is done using .equals method
    return this.name.equals(m2.name);
  }
}