subject

Write a Java program that stores information about a company. You should define two classes: Employee which represents the employees in the company, and Department which represents the departments the employees are in. Class definition The classes should have the following fields: ▪ Department • String name ▪ Employee • String firstName • String lastName • double salary • Department department Notes: 1. All fields should be private. 2. You should define a constructor that takes as parameters all fields in each class. 3. You should define a getter and a setter for all fields in each class. 4. The field salary on class Employee should never be a negative number. 5. You should define a method getFullName on class Employee that returns the employees full name as a String. Main Program after you have defined the classes, In the main method define two objects of type Department as follows: # name 1 Sales 2 AccountingThen define an array of type Employee and fill it with the following Employee objects: # firstName lastName salary department 1 John White 1000 Department object 1 (Sales) 2 David Ford 1500 Department object 1 (Sales) 3 Sophie Beech 1200 Department object 1 (Sales) 4 Mary Howe 1300 Department object 2 (Accounting) 5 Susan Brand 1400 Department object 2 (Accounting) the program should show the user the following menu and wait for input from the user: 1. Show all employees 2. Show employees for department 3. Show employee with max salary Option 1: shows the employee’s full name, salary and department name for all employees Option 2: asks the user for a department name then shows the employee’s full name, salary and department name for that department. Option 3: shows the full name, salary and department name for the employee with the maximum salary in the company

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:50
What is a rush associated with alcohol?
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
question
Computers and Technology, 23.06.2019 21:40
Draw the resistor’s voltage and current phasors at t=15ms. draw the vectors with their tails at the origin. the orientation of your vectors will be graded. the exact length of your vectors will not be graded.
Answers: 2
question
Computers and Technology, 24.06.2019 14:30
Two students are discussing electricity that has a frequency of 60 hz. student a says that this type of electricity is referred to as ac. student b says that in this type of electricity, the electrons flow in only one direction. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
You know the right answer?
Write a Java program that stores information about a company. You should define two classes: Employe...
Questions
question
Mathematics, 07.05.2020 03:04
question
Mathematics, 07.05.2020 03:04
Questions on the website: 13722361