We can't post a solution before Thursday night but help has been posted as follows: Please, be sure to check those.

Problem 7.3 should be straightforward.


Here's the entire source code for a possible solution to problem 7.1:

public class Firm {
  public static void main(String[] args) {
    Staff personnel = new Staff(); 
    personnel.payday(); 
  } // method main
} // class Firm 
      
class Staff {
  Staff_Member[] staff_list = new Staff_Member[6]; 
  public Staff() {
      
    // Put together your staff.
      
    staff_list[0] = new Executive("Sam",   "u0031",        "5-0648", 1923.07); 
    staff_list[1] = new Employee ("Carla", "u0020",      "334-1234",  846.15); 
    staff_list[2] = new Employee ("John",  "u1823",              "",  769.23); 
    staff_list[3] = new Hourly   ("Diane", "u0004",        "5-2510",    8.55); 
    staff_list[4] = new Volunteer("Norm",  "u3003",  "317-235-6635"         ); 
    staff_list[5] = new Volunteer("Cliff", "u1066", "1-401-6291667"         ); 

    // Additional set up for certain employees for payment. 

    ((Executive)staff_list[0]).award_bonus(5000); 

    ((Hourly)staff_list[3]).add_hours(40);
      
  } // constructor Staff 

  public void payday() {
      
    double amount; 
      
    for (int count = 0; count < staff_list.length; count++) {
      staff_list[count].print(); 
      amount = staff_list[count].pay(); 
      if (amount == 0.0) System.out.println("Thanks!"); 
      else System.out.println("Paid: " + amount); 
      System.out.println("**********************"); 
    }
  } // method payday 
} // class Staff

class Staff_Member {
  protected String name;
  protected String username; 
  protected String phone; 
  
  public Staff_Member(String name,
                      String username, 
                      String phone) {
    this.name = name;  
    this.username = username; 
    this.phone = phone;    
  } // constructor Staff_Member 

  public double pay() {
    return 0.0; 
  } // method pay 

  public void print() {
    System.out.println("Name: "   + name);
    System.out.println("E-mail: " + username + "@firm.com");
    System.out.println("Phone: "  + phone);
  } // method print 

} // class Staff_Member 

class Volunteer extends Staff_Member {

  public Volunteer (String v_name, 
                    String v_username, 
                    String v_phone) {
    super (v_name, v_username, v_phone); 
  }

  public double pay() {
    return 0.0; 
  }

} // class Volunteer 

class Employee extends Staff_Member {
  
  protected double pay_rate; 

  public Employee(String emp_name, 
                  String emp_username, 
                  String emp_phone, 
                  double emp_rate) {
    super(emp_name, emp_username, emp_phone); 
    pay_rate = emp_rate; 
  } // constructor Employee 

  public double pay() {
    return pay_rate; 
  } // method pay

  public void print() {
    super.print(); 
    System.out.println("Pay rate: " + pay_rate); 
  } // method print 

} // class Employee 

class Executive extends Employee {

  private double bonus; 

  public Executive(String exec_name, 
                   String exec_username,
                   String exec_phone,
                   double exec_rate) { 
    super(exec_name, exec_username, exec_phone, exec_rate); 
    bonus = 0; 
  } // constructor Executive 

  public void award_bonus(double exec_bonus) {
    bonus = exec_bonus; 
  }

  public double pay() {
    double paycheck = super.pay() + bonus;
    bonus = 0; 
    return paycheck; 
  } // method award_bonus 

  public void print() {
    super.print(); 
    System.out.println("Current bonus: " + bonus); 
  } // method pay 

} // class Executive 

class Hourly extends Employee {
  
  private int hours_worked; 

  public Hourly(String hr_name, 
                String hr_username, 
                String hr_phone, 
                double hr_rate) {
    super(hr_name, hr_username, hr_phone, hr_rate); 
    hours_worked = 0; 
  } // constructor Hourly 

  public void add_hours(int more_hours) { 
    hours_worked += more_hours; 
  } // method add_hours 

  public double pay() {
    return pay_rate * hours_worked; 
  } // method pay

  public void print() {
    super.print(); 
    System.out.println("Current hours: " + hours_worked); 
  } // method print   
  
} // class Hourly 

Here's the code for a possible solution to problem 7.2:


And here's the code for the solution to problem 7.3: