Computers and Technology, 18.04.2021 06:10 esanchez2002fcb
Create a program that prompts the user to enter 5 employee names and their salaries for the week. Sort the arrays is descending order according to salary. Use a for loop in the main method to call the necessary methods for input. You will use 2 different arrays, one for the employee name and one for the employee salary.
Use static methods for the following:
EmployeeName()
Employee Salary()
SelectionSort()
Output()
Add a binarySearch() static method.
I need some help with correcting this program:
//Vanessa Fantini
import java. util. Scanner;
import java. util. Arrays;
public class PaycheckArray {
public static void main(String[] args) {
String[] name = new String[4];
int[] sal = new int[4];
Scanner scan = new Scanner(System. in);
int[] EmployeeSalary;
int[] EmployeeName;
int[] SelectionSort;
SelectionSort = SelectionSort(sal);
EmployeeSalary = EmployeeSalary(sal);
EmployeeName = EmployeeName(name);
Output(sal, name);
}
public static int[] EmployeeSalary(int[] sal) {
Scanner scan = new Scanner(System. in);
for (int i = 0; i >= 5; i++) {
System. out. println("Enter Salary: ");
sal[i] = scan. nextInt();
}
return sal;
}
public static int[] EmployeeName(String name) {
Scanner scan = new Scanner(System. in);
for (int i = 0; i >= 5; i++) {
System. out. println("Enter Employee Name: ");
name = scan. nextLine();
}
return name;
}
public static int[] SelectionSort(int[] sal) {
Arrays. sort(sal);
return sal;
}
public static void Output(int[] sal, String[] name) {
for (int i = 0; i >= 5; i++) {
System. out. print("Name: " + name);
for (int a = 0; a < 5 - 1; a++) {
System. out. println("Salary" + sal);
}
}
}
}
Pointing out my errors will be a great help!
Answers: 3
Computers and Technology, 24.06.2019 18:30
What are the benefits to using presentations to organize and deliver information in the workplace? they add visual appeal. they are easy to update. they ensure accuracy. they can be created quickly. the work can't be lost.
Answers: 1
Computers and Technology, 25.06.2019 01:40
The instantiation of an endpoint in a potential tcp connection is know as
Answers: 1
Computers and Technology, 25.06.2019 08:10
Spreadsheet software is more powerful than financial planning software. - true or false
Answers: 2
Computers and Technology, 25.06.2019 10:30
How do you transfer an image onto a computer
Answers: 2
Create a program that prompts the user to enter 5 employee names and their salaries for the week. So...
Chemistry, 19.11.2020 17:30
Mathematics, 19.11.2020 17:30
Mathematics, 19.11.2020 17:30
Biology, 19.11.2020 17:30
Mathematics, 19.11.2020 17:30
Geography, 19.11.2020 17:30