Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Declare and define a function that computes bonus for an employee depending on the base salary and the number of years of experience of the
Declare and define a function that computes bonus for an employee depending on the base salary and the number of years of experience of the employee. Inside the function, check the number of years of experience. If the number of years of experience is greater than 5 years, the bonus is 5% of the base salary, otherwise it is 3% of the base salary. You will need to call this function from your main function and pass the base salary and the number of years as arguments. Start with the following template to write you program. #include using namespace std: {/function declaration is provided double compute_bonus(double base_salary, int experience): int main() { double base_salary; int experience; ffget the values of base salary //and experience from the use: /fcall compute bonus by passing necessary parameters deisplay the Eonus returned by the function return *; } //function definition /*Enter the function header here*/ { double bonus: //compare experience and calculate bonus //return the computed bonus } Now, modify the above program, referring to the comments included in the code. Complete the requested changes, and then save the file as Lab6C . cpp, making sure it compiles and works as expected. Note that you will submit this file to Canvas
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started