Hello, When I execute my code, it comes up with this error.
Here is my code:symbol : variable type location: class Employee2 return type; ^ \\puma\home\\Employee2.java:53: cannot find symbol symbol : variable type location: class Employee2 type = "salaried"; ^ \\puma\home\\Employee2.java:55: cannot find symbol symbol : variable type location: class Employee2 type = "hourly"; ^ \\puma\home\\Employee2.java:59: cannot find symbol symbol : variable type location: class Employee2 if(type == "salary") { ^ \\puma\home\\Employee2.java:68: cannot find symbol symbol : variable type location: class Employee2 } else if (type == "hourly") { ^ \\puma\home\\Employee2.java:75: cannot find symbol symbol : variable type location: class Employee2 Employee2 Employee1 = new Employee2(name, type, rate, hours, salary, bonusPay); ^ 6 errors Process completed.
All help is appreciated thank you in advance;import java.util.*; public class Employee2 { //Varibales private static double salary, rate, hours, weeklyPay = 0; private static String name; private static String typeH; static boolean bonusPay = false; //Constructor creates Employee object public Employee2(String name, String status, double hours, double rate, double salary, boolean bonusPay) { if (status == "salaried") { this.salary = salary; if(bonusPay == true) { salary = salary * 1.1; } } else { this.rate = rate; this.hours = hours; if(hours > 40) { //calculates and adds overtime pay weeklyPay = (hours - 40) * (2*(salary)) + 40 * salary; } else { weeklyPay = rate * hours; } } } //Methods to obtain information about a specific employee private double getWeeklyPay() { return weeklyPay; }private String getName() { return name; }private double getSalary() { return salary; }private String getType() { return type; }private double getHours() { return hours; }private double getRate() { return rate; } private void printData(Employee2 x) { } public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Hello! Welcome to Employee Database"); System.out.println("If Employee is salaried enter S. Otherwise enter H for hourly"); if(input.nextLine().toLowerCase().contains("s")) { type = "salaried"; } else if(input.nextLine().toLowerCase().contains("h")) { type = "hourly"; } System.out.println("Enter Employee's full name"); name = input.nextLine(); if(type == "salary") { System.out.println("Enter weekly salary"); salary = input.nextDouble(); System.out.println("Enter Y if employee receives a bonus of 10%, otherwise enter N"); if(input.nextLine().toLowerCase().contains("y")) { bonusPay = true; } else { bonusPay = false; } } else if (type == "hourly") { System.out.println("Enter hourly pay"); rate = input.nextDouble(); System.out.println("Enter # of hours"); hours = input.nextDouble(); } Employee2 Employee1 = new Employee2(name, type, rate, hours, salary, bonusPay); System.out.println(); System.out.println("\t Name Status Hours Rate Weekly Pay Amount"); System.out.println("\t======================================================================"); System.out.println(Employee1.getName() + Employee1.getType() + Employee1.getHours() + Employee1.getRate() + Employee1.getWeeklyPay()); System.out.println(); } }