title: The left-hand side of an assignment must be a variable?
body: <p>I'm trying  to do a uni activity which involved writing the following program. I keep getting an error on line 27 where I've got <code>else  (employeetype == 2) {</code>, the error is as follows <code>The left-hand side of an assignment must be a variable
      Syntax error, insert "AssignmentOperator Expression" to complete Assignment
      Syntax error, insert ";" to complete Statement</code>.</p>
  
  <p>I'm new to java and don't really understand what I've done wrong here as the same assignment works in the if statement properly but not the else.</p>
  
  <p>Could someone help me please?</p>
  
  <pre><code>import java.util.*;
  public class TaskFive {
  
      public static void main(String[] args) {
          Scanner console = new Scanner(System.in);
  
          System.out.println("Please type 1 if you are hourly rated or 2 if you are a salesperson.");
          double employeetype = console.nextDouble();
          double pay;
  
          if (employeetype == 1) {
              System.out.println("Please enter your hourly rate:");
              double hourly = console.nextDouble();
  
              System.out.println("Please enter the total hours you worked:");
              double hoursworked = console.nextDouble();
  
              if (hoursworked &gt; 40) {
              double  overtimepay = hoursworked - 40;
               pay = (overtimepay * (hourly * 1.5)) + (40 * hourly);
              }
              else {
               pay = (hoursworked * hourly);
              }}
  
              else  (employeetype == 2) {
              System.out.println("Please enter your commission rate as a decimal:");
              double comrate = console.nextInt();
              System.out.println("Please enter your sales value:");
              double sales = console.nextInt();
  
              pay = 500 + (sales * comrate);
  
              }
  
          double tax = (pay*.3);
          double netsalary = pay - tax;
  
          System.out.println("Tax: " + tax);
          System.out.println("Net Salary: " + netsalary);
  
          }
  
      }
  </code></pre>