Question: C. Nested if-else In this program, you will compute the bonus for an employee. The bonus of the employee depends on salary, number of years

 C. Nested if-else In this program, you will compute the bonus

C. Nested if-else In this program, you will compute the bonus for an employee. The bonus of the employee depends on salary, number of years of experience and satisfactory performance. Use a floating-point variable for salary, integer variable for experience and a character variable for satisfactory performance to read data from the user. Assume the user is going to enter 'Y' or 'y' for satisfactory performance. Using printf and scanf, get the values for salary, experience, and performance. o Read the character variable first, otherwise the program may not read it properly In a nested if-else block, first check if the user entered 'Y' or 'y' for satisfactory experience. If the user entered 'Y' or 'y', compute bonus as follows. o If the employee has worked for at least 10 years, the bonus is 8% of the salary. o Otherwise, the bonus is 5% of the salary. If the user DID NOT enter 'Y' or 'y', compute bonus as follows. o If the employee has worked for at least 10 years, the bonus is 3% of the salary. o Otherwise, there is no bonus. Using printf, display the bonus using a suitable message. The value of bonus must have 2 digits after the decimal point and $ sign in front of the value (for example $125.85)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!