Run the programs. Programming Review 2" and capture the input and output: ) Show all employees in your array. g) Show the average salary. h) Show the employee who earns the highest salary.
USE Main.Java file....
![Run the programs. "Programming Review 2" and capture the input and output:
f) Show all employees in your array.
g) Show the average salary.
h) Show the employee who earns the highest salary.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3ded9074-643d-40d8-825c-f0dff7af7ebf%2Fad054ed7-c390-46a1-8a8f-c1414060ada9%2Ffdi89i_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step 1: Declare class Employee with fields empName and empsal.
Step 2: Define the main() method.
Step 3: Prompt and accept the number of employees from the user.
Step 4: Create an array of objects of type Employee.
Step 5: Prompt and accept the name and salary of the employees from the user.
Step 6: Iterate for loop and display the name and salary of all the employees.
Step 7: Find the sum of salaries of all the employees and divide it by number of employees to determine the average salary.
Step 8: Initialize highestSalary to 0 and iterate for loop to compare the salary of the employee with highestSalary. Update it when a value greater than the value stored in it is encountered. Display the value stored in highestSalary.
Step by step
Solved in 3 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)