Lab 2 Wed September 16,2009

In this exercise you will examine a program used by a company -- not GW- that determines whether to add a bonus to an employee's salary based on their performance rating. This performance rating is input by the user (who we will assume is a manager) and must be a positive integer. Every employee gets a $1000 bonus added to their salary to begin with; i.e., if their rating is a 0 then they will get $1000 bonus. For each bonus point they get a $1000 increase in salary. However, the maximum bonus they can get is capped at $10,000 -- i.e., the variable max_bonus is $10,000. For example, if their rating is 3 then their total bonus earned is $4000. If their rating is 12 then their total bonus earned is $10,000. After computing the total bonus they will earn, the program outputs the total bonus earned (including the base $1000) and their new salary. For example, if their salary is 100,000 and their performance rating is 2 then their bonus should be $3000 and their new salary is $103,000.

Your task is to examine the C program provided to you which takes as input the employee salary and their performance rating and prints to the screen the total bonus dollars they received and their new salary. Is this program correct for all possible values of inputs. Run the program for different values of rating and salaries to figure out if this program is correct. Your task is to determine (a) if the program is correct and (b) if it is incorrect then to identify the problem and fix it.