subject

Use BlueJ to write, test, and execute a program that reads a sequence of data for several employee objects from an input file. Use notepad to create input file "inData. txt". File should be stored in the same folder where all files from BlueJ for this program are located. Class Employee describes one employee object and has variables empID, fName, lName title of String type, and salary of type int. In addition, class Employee has constructor to initialize all data, getter methods to access data, and has the following methods:
public boolean isHighEarner() // returns true if employee has salary above 100000 and false otherwise
public String toString() // returns string with all employee’s data in one line separated by tabs.

Design class Department that has instance variable list which is of ArrayList type. Variable list is initialized in the constructor by reading data for each employee from an input file. Each line of input file "inData. txt" has empID, fName, lName title, and salary in this order, and separated by a space. Input file should contain minimum of 8 employees, but not more than 100. Program should stop readding from the input file when it reaches the end of file, or if number of emplyees reaches 100. The data for the first five employees in the input file should be as follows:
1234e2 Ann Smith manager 67000
1233e7 Mark Lewis programmer 111000
9876e2 Ford Smith secretary 49000
3451e7 Ann Taylor programmer 138000
4567e9 Sue Lee programmer 91000
… Add remaining employees of your choice.

Class Department also has the following methods:
// Returns string representation of list of all employees (each row has data for one employee)
•public String toString()

//Prints "List of high earner employees in the department " followed by complete data for each high earner employee
•public void printHighEarners()

// Method returns Employee object with highest salary. In case of multiple employees with the same highest salary,
// return first such employee in the list.
•public Employee highestEarner()

// Method accepts a title and returns count of employees with given title.
•public int countEmployeesWithTitle(String title)

// Returns ArrayList of all employees from the list that are both highEarners and programmers.
•public ArrayList highEarnerProgrammers()

The first method and the last three methods do not print anything, they just return the specified data. Print English explanation about the method results at the place where those methods are invoked. None of the methods should change the list of employees. That means that the list of employees remains the same before and after invoking any of the methods.
Class TestEmployeeList will have main method. Invoke each of the five methods from Department class. If method countEmployeesWithTitle returns zero, report that there are no employees with specified title, otherwise print count with full sentence. Test the method twice: once by passing title "programmer" and second time by passing a title that none of employees has.

NOTE: Do not forget to append throws IOException to the constructor of the class Department and to the main method header in class TestEmployeeList. In addition, you have to import the following packages in order to use Scanner and ArrayList classes.
import java. io.*;
import java. util.*;

Every class should start with comment that includes your name, class section, meeting days, project number and date of submission and brief description what is the class about.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
How do you make a lenny face? plz, brailiest to who can answer first.
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
For the following example of making a peanut butter and jelly sandwich, identify which are inputs, processes, or outputs: bread scooping and spreading peanut butter plate scooping and spreading jelly finished sandwich putting two pieces of covered bread together dirty plate crumbs
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
You know the right answer?
Use BlueJ to write, test, and execute a program that reads a sequence of data for several employee o...
Questions
question
Mathematics, 13.06.2020 18:57
Questions on the website: 13722360