I just need simple pseudocode for this, for example https://www.chegg.com/homewo
ID: 3765974 • Letter: I
Question
I just need simple pseudocode for this, for example
https://www.chegg.com/homework-help/questions-and-answers/solution-link-part-2-workplease-check-problem-requires-modify-solution-https-wwwcheggcom-h-q8876263
there is no coding in that solution, it just simple pseudocode
If this image is too small to read, then just right click and then click view image :)
NO CODING PLEASE, JUST SIMPLE PSEUDOcODE Question You are given a file that contains the names of the departments in a store and the number of employees that work in each department. You are to create one array named Departments to store the department names and a second array named Employees to store the number of employees in each department. A sentinel value of XXXXXX will be used for the department name to signal the end of file. You are to develop separate modules for each processing step listed below: 1. Input the department names into an array named Departments and the number of employees into an array named Employees 2. Total number of employees workings in all departments. 3. The number of employees and department name for all departments with less than 25 employees. 4. The average number of employees in all of the departments. 5. The number of employees and department name for the first department with less than 25 employees.Explanation / Answer
Pseudocode of program
START
Set default size=10
Declare count variable=0
Declare arary of type
String departments[size]
Declare arary of type integer to store departments
int employees[size]
Call module readFile(departments,employess)
Call module CountEmployees(employess,count)
Call module printDeptEmplessthan25(departments,employess)
Call module printFirstDeptEmplessthan25(departments,employess)
Call module averageEmployees(employess,count)
END
Module readFile(departments,employess) :Returns size of records in file
Declare integer size=0
Declare deptName as string
Open file "employee.txt"
Read deptName name from file
WHILE deptName!="XXXXXX"
departments[size]=deptName
Read numEmp from file
employees[size]=numEmp
Read deptName name from file
Inrement size=size+1
END WHILE
Return size
Module printDeptEmplessthan25(departments,employess) :
Set i as integer =0
Read deptName name from file
WHILE i< count
if(employees[i]<25)
print departments[i]
pritn employess[i]
Inrement i=i+1
END WHILE
Return
Module printFirstDeptEmplessthan25(departments,employess) :
Set i as integer =0
Set a boolean found as false
Read deptName name from file
WHILE i< count AND !found
if(employees[i]<25)
Set found to true
print departments[i]
pritn employess[i]
Inrement i=i+1
END WHILE
Return
Module CountEmployees(employess,count)
Declare total as integer =0
Declare i as integer =0
WHILE i<count
total+=employees[i]
Return total
Module averageEmployees(employess,count)
Declare average as integer =0
Declare i as integer =0
WHILE i<count
total+=employees[i]
average=total/count
i=i+1
END WHILE
Return average