Question: import java.util.ArrayList; import java.util.Scanner; public class Salary { public String name; public Double hour; public Double rate; public Double calculate() { return hour * rate;

import java.util.ArrayList; import java.util.Scanner; public class Salary { public String name; public Double hour; public Double rate; public Double calculate() { return hour * rate; } } public class TestSalary { ArrayList employeeArray = new ArrayList(); public void main(String[] args) { Scanner in = new Scanner(System.in); public void sethighest(double max); return max; int i = 0; while (true) { Salary s = new Salary(); System.out.print("Enter the name of Employee or Q to exit: "); String n = in.nextLine(); if (n.equalsIgnoreCase("Q")) { return; } else if(n == "R") { // remove name System.out.print("Enter the name of Employee"); String removedEmployee = in.nextLine(); for (Salary sal : employeeArray ) { if(sal.name == removedEmployee) { employeeArray.remove(sal); System.out.print("Its removed !!"); } } } else { // Adding name s.name = n; System.out.print("Enter the number hours worked: "); s.hour = in.nextDouble(); System.out.print("Enter the pay rate per hour: "); s.rate = in.nextDouble(); employeeArray.add(s); } for (Salary salary : employeeArray) { System.out.println("name of Emp" + salary.name); System.out.println("Salary" + salary.calculate()); //System.out.println(name + "\t\t" + hour + "\t\t" + salary); } } } } can any one help fix the errors

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!