As far as I know, I think the rest of my code are fine except for the switch statement part. Whenever I run the program, it always says that the switch statement has no effect.
In this lab, write a C++ program that calculates an employee’s end-of-year bonus and prints the employee’s name, yearly salary, performance rating, and bonus. In this program, bonuses are calculated based on employees’ annual salary and their performance rating.
Testing:
Employee Name: Jeanne Hanson
Employee Salary: $70000
Employee Rating: 2
Employee Bonus: $10500 =====this part is where the output I get is wrong...instead of showing $10500 which is the correct value...it shows $32767.
Yes, there is a way to fix it. employeBonus is undefined int employeeBonus; is never assigned any value. You run your current program 10 times, you will likely get 10 different output as employeeBonus
It is because you passed the wrong value in the switch statement. It does nothing since there is no matching case. You are passing employeeBonus instead of employeeRating
Compare line 5 of my code with line 28 of your recent code