Question: Write the application class and define: a method that finds and returns the employee who earns the lowest salary, a method that prints all employees

Write the application class and define:
- a method that finds and returns the employee who earns the lowest salary,
- a method that prints all employees in the array
- a method that returns the average salary
- the main method that creates an array of Employee, then test a), b), c)
import java.util.Scanner; public class Employee public int id; public String name; public double salary; public void Input() { System.out.println("Enter name: "); name = new Scanner(System.in).nextLine(); System.out.println("Enter ID: "); id = Integer.parseInt(new Scanner(System.in).nextLine()); System.out.println("Enter Salary: "); salary - Double.parseDouble(new Scanner(System.in).nextLine()); } public void Output() { System.out.printf("Name: $155, ID: %255, Grade: %3$s ", name, id, salary); 3 public String toString() { return String.format("Name: %15, ID: $2$, Grade: %3$s", name, id, salary); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
