A company plans to give a monthly bonus to its employees by the following criteria: if the employee’s monthly salary is less than $2,000, the bonus is 30% of the salary; for employees with salaries greater than or equal to $2,000 and less than 3000$, the bonus is $500. For others no bonus is given. Write an algorithm (pseudo code) which will compute and print out the sum for the entered employees’ salaries before the bonus and the sum for salaries after the bonus for a certain month. The system keeps reading the salaries of employees (one salary at a time) until a salary of 0 is entered by the user
Algorithm (pseudo code)
Step 1: Input NAME,Salary_month=0,Total_salary=0, Salary, Total_bonous=0
Step 2: if (Salary > $2,000) then
Salary = Salary +Salary *0.3 ;
Total_salary=Total_salary+Salary ;
Total_bonous=Total_bonous+Salary *0.3 ;
else if (Salary >= 2000$ and Salary < 3000$) then
Salary = Salary +$500 ;
Total_salary=Total_salary+Salary ;
Total_bonous=Total_bonous+$500 ;
else
Salary = Salary +0 ;
Total_salary=Total_salary+Salary ;
Total_bonous=Total_bonous+0 ;
endif
Step 3: Print “sum for the entered employees’ salaries before the bonus ”, “is $”, (Total_salary-Total_bonous)
Print “sum for salaries after the bonus for a certain month”, “is $”, (Total_bonous)
Get Answers For Free
Most questions answered within 1 hours.