7. A company pays an annual bonus to its employees. The bonus is calculated by m
ID: 3884713 • Letter: 7
Question
7. A company pays an annual bonus to its employees. The bonus is calculated by multiplying the employee's annual salary by a bonus rate, which is based on the number of years the employee has been with the company. Employees working at the company for less than 5 years receive a 1% bonus, all others receive a 2% bonus. Using only the instructions shown in Figure 1-11, write two versions of an algorithm that prints each employee's bonus. (Hint: The selection structure will be different in each version.) Be sure to indent the instructions appropriately calculate the bonus by multiplying the salary by 1% calculate the bonus by multiplying the salary by end if end repeat enter the salary and years employed if the years employed are greater than or equal to 5, do this: ifthe years employed are less than 5, do this otherwise, do this: print the bonus repeat Figure 1-11 Instruction set for Exercise 7 © Cengage Learning 2013Explanation / Answer
I am answering only question 7, since we are allowed to only answer 1 question in case of multiple questions, please find the answer below
version1
repeat for each employee
enter the salary and years employed
if the years employed are less than 5,do this:
calculate bonus by multiplying the salary by 1%
otherwise, do this:
calculate bonus by multiplying the salary by 2%
print the bonus
end repeat
version2
repeat for each employee
enter the salary and years employed
if the years employed are greater than or equal to 5,do this:
calculate bonus by multiplying the salary by 2%
otherwise, do this:
calculate bonus by multiplying the salary by 1%
print the bonus
end repeat
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.