Answer:
You need to write the code that calculates the bonus based on the employee's performance rating and salary. This calculation should be done inside the switch statement and the bonus variable should be updated with the correct value. You can use the numPerformanceRate and numSalary variables to determine the bonus, and the BONUS_1, BONUS_2, BONUS_3, and BONUS_4 constants to calculate the bonus.
Step-by-step explanation:
switch (numPerformanceRate) {
case RATING_1:
bonus = numSalary * BONUS_1;
break;
case RATING_2:
bonus = numSalary * BONUS_2;
break;
case RATING_3:
bonus = numSalary * BONUS_3;
break;
case RATING_4:
bonus = numSalary * BONUS_4;
break;
default:
cout << "Invalid performance rating. Please enter a number between 1 and 4." << endl;
break;
}