Computing A Raise

  1. Complete the Salary.java program to determine the raise and new salary for an employee by adding if ... else statements to compute the raise. The input to the program includes the current annual salary for the employee and a number indicating the performance rating (1=excellent, 2=good, and 3=poor). An employee with a rating of 1 will receive a 6% raise, an employee with a rating of 2 will receive a 4% raise, and one with a rating of 3 will receive a 1.5% raise. Hand in hardcopy of the finished program, as well as a transcript of at least three runs of the programming that illustrate the use of the three different inputs.
  2. File SalaryText.java contains a modified version of the previous program. The program differs in that the performance rating here is entered as a String -- the three possible ratings are "Excellent", "Good", and "Poor". An employee who is rated excellent will receive a 6% raise, one rated good will receive a 4% raise, and one rated poor will receive a 1.5% raise. (Another difference is that the formatted output is generated via a different mechanism than "printf".)

Add the if... else... statements to program SalaryText to make it run as described above. Note that you will have to use the equals method of the String class (not the relational operator ==) to compare two strings. Hand in hardcopy of the finished program, as well as a transcript of at least three runs of the programming that illustrate the use of the three different inputs.