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: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:10
Linux is distributed under gnu gpl. why is this important? a. it ensures that only torvalds can profit from the sale of linux b. it prevents unknowledgeable users from downloading programs they don't know how to operate. c. it provides protection for the developers who created linux. d. it states that anyone can copy, modify, and share the program if changes are made public.
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
The graph shows median weekly earnings for full-time workers according to education level. which can you not conclude?
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
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
Business, 02.10.2019 08:30
Questions on the website: 13722361