Processes:

Processes:

1.
2.
3.
4.
5.
6.
7.

Prompt the user to enter the employee’s name.
Prompt the user to enter the employee’s salary.
Prompt the user to enter 0 (zero) to end the program and total the average.
Do not store zero
Find the total average of all the employees’ salaries.
Find the total amount of salaries above and below the mean (average) salary.
Display the average salary and the salaries above and below the mean (average)

Input:
Employee’s name
Employee’s salary

Output:
Average salary
Employees making above the mean
Employees making below the mean

Pseudocode:

Main Module
Declare Names as string
Declare Salary as float
Declare sums as float
Declare Count as integer
Call Input Module
Call Find Average Module
Call Display Module
End Main Module

Input Module
Write “Enter Employee’s Name and Salary.”
Write “Enter 0 when done.”
Input Name
Input Salary
Set Sum = 0
Set Mean1 = 0
Set K = 1
While Salary > “0”
Set Mean1 = Count1 + 1
Set Sum = Sum + Salary

(string: data a…z)
(float > 0.00)

(float > 0.00)
(Integer = > 0)
(Integer = > 0)

Write “Enter another Employee’s Name and Salary (enter 0 when done)”
Input Name
Input Salary
End While
End Input Module

Find Average Module
Declare Counts as integer
Declare Salary as float
Declare K as integer
Declare Average as float
Set Average = Sum / Count1
Set Count2 = 0
Set Count3 = 0
For K = 1 Step 1 to Count1
If Salary[K] > Average Then
Set Count2 = Count2 + 1
End If
If Salary[K] < Average Then
Set Count3 = Count3 + 1
End If
End For
End Find Average Module

Display Module
Write “The Average Salary is: $”, Average
Write “The number of Salaries Above the Average Salary is:”, Count2
Write “The number of Salaries Below the Average Salary is:”, Count3
End Display Module

Leave a Reply