Question: So I have written this entire code, and have lost myself on what I am trying to do. Before this assignment, my professor had us



So I have written this entire code, and have lost myself on what I am trying to do. Before this assignment, my professor had us make a program using arrays, so I figured using an array in this scenario would make sense. However, I am not sure where I am going with it because I am practically coping the code from that assignment. I have become confused by my own work, and want to know if I have the right idea using arrays and if/else statements for this problem. Please help me understand the best route for solving this problem. Is it more simple than I am making it out to be?
Employee Details Define a class named Employee with following characteristics: Data members int employeeld String employeeName String designation int salary Methods void getEmployee() - Accepts console input for employeeld, employeeName, designation, and salary. void showGrade - Displays grade of an employee based on criteria specified below. Void ShowEmployee() - Displays employee details. Grade Salary 0 to 20000 20001 to 50000 50001 to 100000 100001 and above Input Codezinger Software Developer 800000 where, First line represents employee ID. Second line represents employee's name. Third line represents employee's designation. Fourth line represents employee's salary. Output Employee grade is: A Grade Employee details are: Employee ID=1 Employee Name=Codezinger Designation=Software Developer Salary=800000 where, Display grade with " Grade" appended to it. Employee details are separated by a new line. No new line should be present after salary. + Test Case(s) 1- import java.util.*; class Employee { int employeeID; String employeeName String designation; int salary; int count; Employee[] employeeArray = new Employee[10]; public void getEmployee(int employeeID, String employeeName, String designation, int salary) { 14 //accepts console input for employeeID, employeeName, designation, and Salary employeeArray[count] = new Employee(); employeeArray[count].employeeID = new employee ID; employeeArray[count].employeeName = new employeeName; employeeArray[count].designation = new designation; employeeArray[count]. salary = new salary; count++; public void showGrade() { //displays grade of an employee based on criteria specified char A = 'A'; char B = 'B'; char c = 'C'; char D = 'D'; if (salary >= 0 || salary = 20001 || salary = 20001 || salary = 50001 || salary = 100001){ System.out.println(A + " Grade"); public void ShowEmployee() { //displays employee details System.out.println("Employee grade is: "); System.out.println(). public class Solution { public static void main(String[] args) { Scanner console = new Scanner(System.in); int employeeID = console.nextInt(); String employeeName = console.nextLine(); String designation = console.nextLine(); int salary = console.nextInt(); 66 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
