Hello! I am having a hard time with pseudo-code and I have come up with what is below for this question: Input a list of employee names and salaries, and determine the mean (average) salary as well as the number of salaries above and below the mean.

Do you see any areas of improvement or where I can better understand the concept? All help is very much appreciated!!!

Process
1. Display “Salary Average” as program title
2. Prompt user for employee names
3. Prompt user for employee salary
4. Convert average salary
5. Count salaries above average salary
6. Count salaries below average salary
7. Post final results

Input
EmpName (string:EmpName)
EmpSalary (integer:EmpSalary)

Design
Main Module
Call EmpName Module
Select Case
Case Done = No
Display “Please Enter Employee Name”
DIM Employee Name as EmpName
If EmpName is “” Then
Display “Please Re-Enter Employee Name”
Else
Call EmpSalary Module
Display “Please enter “EmpName”’s Salary”
If EmpSalary < 0 Then
Display “Please Re-Enter “EmpName”’s Salary”
Case Done = Yes
Call Average Salary Module
Call Salaries Above Module
Call Salaries Below Module
Display “Thank You!!!”
End Main Module

EmpName Module
Display “Please enter employee name”
Input Employee Name
End EmpName Module

EmpSalary Module
Display “Please Enter EmpName’s Salary”
Input EmpSalary
End EmpSalary Module

Average Salary Module
Sum EmpSalary
DIM EmpName = 1
Count EmpName
Average Salary = Sum EmpSalary/Sum EmpName
End Average Salary Module

Salaries Above Module
If Salary > Average Salary Then Count
End Salaries Above Module

Salaries Below Module
If Salary < Average Salary Then Count
End Salaries Below Module

You should validate the employee's salary in the employee's module (i.e. the employee module should not exit until they have entered a valid salary). Same for the other modules. It makes the "main" part of your pseudocode more concise, and leaves the obvious tasks to the modules that they belong in.

Thanks! I will update the code and remember that for future pseudo-coding.

what does dim mean in the psuedocode? I am just learning and I understand everything except what dim is.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.