Then define an aray of type mployee and fwith the folloing Employee objects firstName astNam White Ford Beech salary 1000 1500 1200 Coioc 1ales) object 1 (Sales object 1 (Sale) object 2 (Acco John Des David Sophie Mary Susan 1400 Deg the program should show the user the following menu and wait for input from the user: 1. Show al employees 2. Showemployes for department 1. howemployewith maary Option shows the employee's name, salary and department name for al employees 1. show all enpleyees 2. show enpleyees for departaent 3. show enployee with nax salary Nane Salary Departaent John hite 1000.0 Sales 1200.0 Sales Sephie Beech David Ford 15e0.0 Sates Mary Howe 1300.0 Accounting Susan Brand 1400.0 Accounting Process finished with exit code

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Then define an array of type Employee and fill it with the following Employee objects
firstName
John
David
astName
White
Ford
Beech
Howe
Brand
department
Department object 1 (Sales)
Department object 1 (Sales)
Department object 1 (Sales)
Department object 2 (Accounting)
Department object 2 (Accounting)
salary
1000
1
2
1500
3
Sophie
Mary
Susan
1200
1300
1400
4
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
1. show all enployees
2. show employees for department
3. shaw employee with max salary
Nane
Salary Departnent
John White 1080.0 Sales
Sophie Beech
David Ford 1500.0 Sales
1280.0 Sales
Mary Howe 1380.0 Accounting
Susan Brand 1480.0 Accounting
Process finished with exit code e
Option 2: asks the user for a department name then shows the employee's full name, salary
and department name for that department.
Transcribed Image Text:Then define an array of type Employee and fill it with the following Employee objects firstName John David astName White Ford Beech Howe Brand department Department object 1 (Sales) Department object 1 (Sales) Department object 1 (Sales) Department object 2 (Accounting) Department object 2 (Accounting) salary 1000 1 2 1500 3 Sophie Mary Susan 1200 1300 1400 4 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 1. show all enployees 2. show employees for department 3. shaw employee with max salary Nane Salary Departnent John White 1080.0 Sales Sophie Beech David Ford 1500.0 Sales 1280.0 Sales Mary Howe 1380.0 Accounting Susan Brand 1480.0 Accounting Process finished with exit code e Option 2: asks the user for a department name then shows the employee's full name, salary and department name for that department.
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
Sales
1
Accounting
Transcribed Image Text: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 Sales 1 Accounting
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY