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, 21.06.2019 22:00
Match the steps of the process to julia's analysis. 1. analyze choices. current costs for making phone calls to foreign countries averages between five and ten cents a minute. 2. determine the goals. julia needs to reduce the cost of telecommunications without reducing her employees' ability to do their jobs. 3. gather data. the corporate computer network will be able to handle the increased traffic that will occur as a result of voip. 4. evaluate the decision. julia will have her it department set up voip in the smallest domestic office. 5. make the decision. julia will have employees document the benefits and problems that result from using the new technology.
Answers: 1
question
Computers and Technology, 22.06.2019 03:00
Data is processed, stored, and transmitted as a series of 1s and 0s. each 1 or 0 is called a(n) . a series of eight 0s and 1s, called a(n) , represents one character—a letter, number, or punctuation mark. data becomes when it is presented in a format that people can understand and use. digital signals are represented by two different , such as +5 volts and +.2 volts. digital data can also take the form of light and dark spots etched onto the surface of a cd or the positive and negative orientation of particles on the surface of a hard disk. data consists of numbers that might be used in arithmetic operations. it can be represented digitally using the number system. data is composed of letters, symbols, and numerals that are not used in arithmetic operations. computers represent this type of data using , ebcdic, unicode, or utf-8. data is quantified using terms such as or kibibyte (1024 bytes), and prefixes such as or mebi (1,048,576), and giga or (1,073,741,824). to reduce file size and transmission times, digital data can be compressed. compression provides the means to compress data and reconstitute it into its original state. compression throws away some of the original data during the compression process. compressed files usually have at the end of the file name and are represented with special icons. these files have to be or unzipped before you can view the data they contain.
Answers: 1
question
Computers and Technology, 22.06.2019 13:00
Write a program which asks you to enter a name in the form of first middle initial last. so you might enter for example samuel p. clemens. use getline to read in the string because it contains spaces. also, apparently the shift key on your keyboard doesn’t work, because you enter it all lower case. pass the string to a function which uses .find to locate the letters which need to be upper case and use toupper to convert those characters to uppercase. the revised string should then be returned to main in the form last, first mi where it will be displayed.
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
1. which of these is not true about torsion bars? a. they can be used to adjust ride height b. they can be adjusted anytime since they don't affect alignment angles c. they attach between the frame and the lower control arm d. they twist to produce a spring effect
Answers: 1
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
Biology, 13.02.2021 14:40
question
Computers and Technology, 13.02.2021 14:40
question
Mathematics, 13.02.2021 14:40
question
Physics, 13.02.2021 14:40
Questions on the website: 13722363