Question
Write program in JAVA** Output** ----jGRASP exec: java lab7.cscd211lab7.CSCD211Lab7 Employee List Programmer: Mr. Ima Nerd Programmer: Mrs. Ima Nerd Accountant: Mr. Bean Counter Accountant: Mrs.
Write program in JAVA**
Output**
----jGRASP exec: java lab7.cscd211lab7.CSCD211Lab7 Employee List Programmer: Mr. Ima Nerd Programmer: Mrs. Ima Nerd Accountant: Mr. Bean Counter Accountant: Mrs. Bean Counter Lawyer: Mr. Lawyer Lawyer: Mrs. Lawyer Employee Report I am a Programmer. I get 60000.0, and I get a bus pass. I am a Programmer. I get 65000.0, and I do not get a bus pass. I am an Accountant. I make 100000.0 plus a parking allowance of 50.0 I am an Accountant. I make 75000.0 plus a parking allowance of 150.0 I am a Lawyer. I get 180000.0, and I have 25 shares of stock. I am a Lawyer. I get 190000.0, and I have 125 shares of stock. Employee List: Natural Order Accountant - Mrs. Bean Counter - 75000.0 Accountant - Mr. Bean Counter - 100000.0 Lawyer - Mr. Lawyer - 180000.0 Lawyer - Mrs. Lawyer - 190000.0 Programmer - Mr. Ima Nerd - 60000.0 Programmer - Mrs. Ima Nerd - 65000.0 Employee List by Salary Programmer - Mr. Ima Nerd - 60000.0 Programmer - Mrs. Ima Nerd - 65000.0 Accountant - Mrs. Bean Counter - 75000.0 Accountant - Mr. Bean Counter - 100000.0 Lawyer - Mr. Lawyer - 180000.0 Lawyer - Mrs. Lawyer - 190000.0 Employee List by Name Accountant - Mr. Bean Counter - 100000.0 Programmer - Mr. Ima Nerd - 60000.0 Lawyer - Mr. Lawyer - 180000.0 Accountant - Mrs. Bean Counter - 75000.0 Programmer - Mrs. Ima Nerd - 65000.0 Lawyer - Mrs. Lawyer - 190000.0
_____________________________________________________________________________________
GIVEN MAIN***
package lab7.cscd211lab7;
import java.io.*; import java.util.*; import lab7.cscd211comparators.*; import lab7.cscd211inheritance.*;
public class CSCD211Lab7 { public static void main(String [] args) { ArrayListmyList = new ArrayList(); myList.add(new Programmer("Mr. Ima Nerd", 40000, 20000, true)); myList.add(new Programmer("Mrs. Ima Nerd", 45000, 20000, false)); myList.add(new Accountant("Mr. Bean Counter", 100000, 0, 50.00)); myList.add(new Accountant("Mrs. Bean Counter", 75000, 0, 150.00)); myList.add(new Lawyer("Mr. Lawyer", 150000, 30000, 25)); myList.add(new Lawyer("Mrs. Lawyer", 170000, 20000, 125));
System.out.println("Employee List"); for(Employee e : myList) System.out.println(e);
System.out.println(); System.out.println("Employee Report"); for(Employee e : myList) e.report(); System.out.println(); Collections.sort(myList); System.out.println("Employee List: Natural Order"); for(Employee e : myList) System.out.println(e.getType() + " - " + e.getName() + " - " + e.getSalary());
System.out.println(); Collections.sort(myList, new SalaryComparator()); System.out.println("Employee List by Salary"); for(Employee e : myList) System.out.println(e.getType() + " - " + e.getName() + " - " + e.getSalary());
System.out.println(); Collections.sort(myList, new NameComparator()); System.out.println("Employee List by Name"); for(Employee e : myList) System.out.println(e.getType() + " - " + e.getName() + " - " + e.getSalary());
System.out.println();
}//end main }// end class
CSCD 211 Lab 7 You are a programmer in the IT department of an important law firm. Your job is to create a program that will report gross salary amounts and other compensation. There are three types of employees in your firm: Programmers Lawyers Accountants Your computer-based solution will use inheritance to reflect the general-to-specific nature of your employee hierarchy. TO TURN IN A zip file that contains Lab 7 - Abstract: All the packages and Java files needed to compile and run your program An output run named cscd211 Lab7out.txt CSCD 211 Lab 7 You are a programmer in the IT department of an important law firm. Your job is to create a program that will report gross salary amounts and other compensation. There are three types of employees in your firm: Programmers Lawyers Accountants Your computer-based solution will use inheritance to reflect the general-to-specific nature of your employee hierarchy. TO TURN IN A zip file that contains Lab 7 - Abstract: All the packages and Java files needed to compile and run your program An output run named cscd211 Lab7out.txtStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started