Processes:

Processes:

 

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

 

Input:

Employee’s name                           (string: data a…z)

Employee’s salary                           (float > 0.00)

 

Output:

Average salary                                                  (float > 0.00)

Employees making above the mean       (Integer = > 0)

Employees making below the mean       (Integer = > 0)

 

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
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