char F, f, H, h, C, c;
double hours_worked, grosspay, netpay, rateof_pay, total_deduction, deduction, overtime, extra_time;
double comm_incent, fixedsalary = 0, taxfree_allow, totalgross_pay, totalnetpay, totalsales = 0;
String empfirst_name, emplast_name, hourlypaid_workers, payroll_report, payroll_payslip, process_workers, monthlyfixed_workers;
String commiss_workers;
int taxes, emp_idnum, highest, lowest,highestpaid_workers, lowestpaid_workers, highestvalue_workers, lowestvalue_workers;
char inputChar = 0, Char;
for(int i=1; i<=3; i++){
System.out.println("please enter the employee id number");
emp_idnum = input.nextInt();
System.out.println("please enter the employee first name");
empfirst_name = input.next();
System.out.println("please enter the employee last name");
emplast_name = input.next();
inputChar = input.next().charAt(0);
if(Character.toUpperCase(inputChar) ==('F') || Character.toLowerCase(inputChar) ==('f')){
System.out.println("/enter your usercode");
System.out.println("please enter the employee fixed salary");
fixedsalary = input.nextDouble();
inputChar = input.next().charAt(0);
else if(Character.toUpperCase(inputChar) == ('C') || Character.toLowerCase(inputChar) == ('c')){
System.out.println("enter your usercode");
System.out.println("please enter the employee fixed salary " + fixedsalary);
fixedsalary = input.nextDouble();
System.out.println("please enter the total sales of the month " + totalsales);
totalsales = input.nextDouble();
inputChar = input.next().charAt(0);
else if(Character.toUpperCase(inputChar)== ('H') || Character.toLowerCase(inputChar)== ('h'));
}
}
}
am now getting an error here. the error is an else without an if
does inputchar have any value, do I need to change it. have been working on this payroll system for a company, it say the user will either enter c or C for commission worker, f or F for a fixed monthly worker or h or H for a hourly paid worker. I have been trying to say that when a worker enter either c or capital C they are a commission worker likewise for the other two and the program would accept either letter may be common or capital and i am stuck at the moment . the error am receiving is else without an if
can someone explain to me how to get past this what does it mean and how to fix it