title: Java program....new to programming
body: <p>this is my first question here, so here it goes, I have tried this for ages with no luck, I am new to Java (studying it) and I have an assignment and I cant get this to work (only the first part works)...thanks in advanced for any help you can give me! :)  </p>
  
  <p>**Write a program to read in a non-specified number of Employee Salaries from the user. After each Employee Salary is entered the program should then calculate the Bonus for each employee. The bonus is to be calculated as a percentage of the Salary, according to the table shown below: </p>
  
  <p>Salary  Bonus Rate </p>
  
  <p>Less than €10,000   5% 
  Between €10,000 and less than €20,000   10% 
  Between €20,000 and less than €30,000   15% 
  €30,000 or more 20% </p>
  
  <p>The Program should output the Bonus Rate, Bonus Amount, and Total Salary for each Employee after the salary is entered. </p>
  
  <p>When the user has entered the details for all employees, the program should then output the following: 
  Overall Total Bonuses paid 
  Overall Total Salaries paid (including bonuses) 
  Average Bonus </p>
  
  <p>Your program should let the user indicate that they have finished entering results. 
  Add extra checks to your program so that negative figures are rejected by the program along with a suitable error message. </p>
  
  <p>Test your program thoroughly, so that it works under all possible conditions. 
  Input/Output from the program should be attractively displayed on the screen. </p>
  
  <pre><code>    import java.util.Scanner;
  
  
              class Salary
              {
               public static void main (String args [])
                 {
                   Scanner myInput = new Scanner (System.in);
  
                    double salary =0, bonusRate =0, bonusAmount=0, salaryTotal=0,                           totalBonus=0, averageBonus=0, totalSalaries=0;
      int salaryCounter=0;
      char response;
  
      do
      {
  
          System.out.println("Press a to enter a salary or press 'q' to quit");
          response=myInput.next().charAt(0);
  
  
          switch(response)
          {
              case 'a':
  
              do
              {
  
              System.out.println("Enter employee salary or press q to quit");
              salary = myInput.nextDouble();
  
                  if (salary &lt;=0)
                  {
                      System.out.println("Invalid entry please enter Salary again ");
                  }
  
                   else if (salary &gt;0 &amp;&amp; salary &lt;=10000)
                  {
                      System.out.println("*************************************************************");
                      System.out.println("The bonus rate is 5%");
                      bonusRate = salary * .05;
                      System.out.println("The bonus is " + bonusRate);
                      salaryTotal= salary + bonusRate;
                      System.out.println("The Total salary " + salaryTotal);
                      salaryCounter=salaryCounter+1;
                      System.out.println("*************************************************************");
  
                  }
                  else if (salary &gt;10000 &amp;&amp; salary &lt;=20000)
                  {
                      System.out.println("*************************************************************");
                      System.out.println("The bonus rate is 10%");
                      bonusRate = salary * .10;
                      System.out.println("The bonus is " + bonusRate);
                      salaryTotal= salary + bonusRate;
                      System.out.println("The Total salary " + salaryTotal);
                      salaryCounter=salaryCounter+1;
                      System.out.println("*************************************************************");
  
                  }
                  else if (salary &gt;20000 &amp;&amp; salary &lt;=30000)
                  {
                      System.out.println("*************************************************************");
                      System.out.println("The bonus rate is 15%");
                      bonusRate = salary * .15;
                      System.out.println("The bonus is " + bonusRate);
                      salaryTotal= salary + bonusRate;
                      System.out.println("The Total salary " + salaryTotal);
                      salaryCounter=salaryCounter+1;
                      System.out.println("*************************************************************");
  
  
                  }
                  else if (salary &gt;30000)
                  {
                      System.out.println("*************************************************************");
                      System.out.println("The bonus rate is 20%");
                      bonusRate = salary * .20;
                      System.out.println("The bonus is " + bonusRate);
                      salaryTotal= salary + bonusRate;
                      System.out.println("The Total salary " + salaryTotal);
                      salaryCounter=salaryCounter+1;
                      System.out.println("*************************************************************");
  
  
                  }
                  //else
                  //{  //do i need to get rid of this?
  
                  //  System.out.println("");
                  //}
  
              }while(salary &lt;=0);{
  
                  break;
  
                  }case 'q':
  
                  salaryCounter = salaryCounter+1;
                  bonusAmount= salary*bonusRate;
                  salaryTotal=salary+bonusAmount;
                  totalBonus=totalBonus+bonusAmount;
                  totalSalaries=totalSalaries+salaryTotal;
                  averageBonus=totalBonus*salaryCounter;
  
  
                  System.out.printf("The Total Salaries paid including Bonus is %.2f " , totalSalaries);
                  System.out.println("Euro");
                  System.out.printf("The Total of Bonuses paid is %.2f ", totalBonus);
                  System.out.println("Euro");
                  System.out.printf("The Total of Average Bonuses paid is %.2f ", averageBonus);
                  System.out.println("Euro");
  
                  break;
  
  
          }//end do
  
  
   //end switch
  
          }while (response != 'q');{
          //do while loop to repeat until 'q' is entered.
  
  
  } //end do while loop
  
  
      }//end main
  
  }//end class
  </code></pre>