1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sedaia [141]
3 years ago
5

Use BlueJ to write, test, and execute a program that reads a sequence of data for several employee objects from an input file. U

se 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.
Computers and Technology
1 answer:
Serjik [45]3 years ago
5 0
I don’t understand it
You might be interested in
To use
sasho [114]

Answer:

Sticky notes

Explanation:

I got the question correct

7 0
3 years ago
Assume your sketch has a variable named silo, which stores an object that is defined by a class you have created. The name of th
yulyashka [42]

Answer:

c. let v = silo.volume();

Explanation:

When you create and initialize a new object you pass through that object's class constructor. The constructor is in charge of initializing all the necessary variables for that class including radius and height. Once you save the object in a specific variable (silo) you need to call the class methods through that variable, using the '.' command. Therefore, in this scenario, in order to call the volume() method you would need to call it from the silo object and save it to the v variable, using the following statement.

let v = silo.volume();

7 0
3 years ago
Can I make all front end project with Javascript OOP(Object Oriented Programming)?
anyanavicka [17]

Answer:

yeah u can my brother go for it

6 0
3 years ago
NTDS Quotas store NT Directory Service quota information that limits the number of Active Directory objects a user, group, compu
Anna35 [415]

Answer:

The anwer is advanced feature folder

Explanation:

Because NTDS QUOTAS is an advanced feature folder that stores NTDS quota information that limits the number of Active Directory objects a user, group, computer, or service can create.

3 0
3 years ago
Select the characteristics of a Base Transceiver Station:
Andru [333]

Answer:

The correct answer to the following question is options A, B, and D.

Explanation:

Base Transceiver Station (BTS) is an apparatus that works wireless communication between the network and user equipment (UE - Mobile phones (handset), wireless network computers). Wireless technologies like wi-fi, GSM, CDMA, etc.

Some elements of BTS :

  • Radio base station
  • Tower/Mast
  • Duplexer
  • Transceiver unit (TRU)
  • Microwave

So the above are the elements of the BSA, then it also having the characteristics related to these elements like it definitely connects to a cell network, sends phone or mobile phone and microwave signals to cellular providers but it isn't able to send the signals to the recepients.

8 0
3 years ago
Other questions:
  • Consider the following method: public static void arrayMystery(int[] array) { for (int i = 0; i < array.length - 1; i++) { if
    10·1 answer
  • What is the purpose of this diamond shape in a flowchart?
    8·1 answer
  • What are some local storage devices?​
    6·1 answer
  • Given the commands below, what do they do? for (position = 1 through aList.getLength()/2) { a = aList.getEntry(aList.getLength()
    11·1 answer
  • A 1000 elements array is used to store integers ascending order . The array is used to search binary search algorithm for the in
    14·1 answer
  • What number system that has 16 numerals
    11·2 answers
  • Choose the best type of loop for each situation.
    6·1 answer
  • Ashley works for a company that helps hospitals hire new doctors. They have written a list of strategies that can be used to int
    12·1 answer
  • What is the reason for taking care of design a good computer human interface ​
    9·2 answers
  • Who is in the age range of 13-15 and wants to join a mine craft smp?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!