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 19:00
The fourth generation of computers emerged between 1970s and 1980s. which technological advancement brought about this generation of computers? which computer architecture was used most in this generation?
Answers: 3
question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 23.06.2019 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
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, 10.05.2021 20:40
question
Mathematics, 10.05.2021 20:40
question
Mathematics, 10.05.2021 20:40
question
Arts, 10.05.2021 20:40
Questions on the website: 13722359