Complete the following files:

Address.java

public class Address { /*** complete this class ***/ }

Department.java

public class Department { /*** complete this class ***/ }

Employee.java

public class Employee { /*** complete this class ***/ }

Manager.java

public class Manager extends Employee { /*** complete this class ***/ }

Worker.java

public class Worker extends Employee { /*** complete this class ***/ }

Use the following file:

Personnel.java

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

public class Personnel
{
    private Scanner in;
    private PrintWriter out;
    
    public Personnel(Scanner in, PrintWriter out)
    {
        this.in  = in;
        this.out = out;
    }
    
    private void readData()
    {
        while (in.hasNextLine()) {
            String line = in.nextLine();
            String tag  = line.split(",")[0];
            
            if (tag.equals("ADDRESS")) {
                Address addr = new Address(line);
                out.println(addr);
            }
            else if (tag.equals("DEPT")) {
                Department dept = new Department(line);
                out.println(dept);
            }
            else if (tag.equals("MANAGER")) {
                Manager mgr = new Manager(line);
                out.println(mgr);
            }
            else if (tag.equals("WORKER")) {
                Worker wrkr = new Worker(line);
                out.println(wrkr);
            }
        }
    }
    
    public static void main(String args[])
    {
        Scanner     in  = null;
        PrintWriter out = null;
        
        try {
            in  = new Scanner(new File("personnel.csv"));
            out = new PrintWriter("personnel.out");
            Personnel p = new Personnel(in, out);
            p.readData();
        }
        catch (FileNotFoundException ex) {
            ex.printStackTrace();
        }
        finally {
            if (in  != null) in.close();
            if (out != null) out.close();
        }
    }
}