Please answer in Pseudocode: No language You are given a file that contains the
ID: 3919035 • Letter: P
Question
Please answer in Pseudocode: No language
You are given a file that contains the course number and the number of students enrolled in each course. You need to use a modular design to solve the problem in Pseudocode.
Place the course numbers and enrollment in parallel arrays.
Print a listing of all course numbers and enrollments.
Calculate and print the total number of students in all classes.
Calculate and print the average number of students in the classes.
Print the class numbers and enrollments for classes with less than 10 students.
Print the class number and enrollment for the class with the highest enrollment.
Explanation / Answer
1. Declare courses[], students[], counter = 0, coursesCount = 0, studentsCount = 0, averageStudents, max = 0
2. for loop the file until the end of file
3. courses[], students[] = line.split(' ')
4. counter++
5. end for loop
6. for i = 1 to counter
7. print courses[i], students[i]
8. end for loop
9. for i = 1 to counter
10. studentsCount += students[i]
11. end for loop
12. averageStudents = studentsCount / count
13. for i = 1 to counter
14. if students[i] < 10 print courses[i], students[i]
15. end for loop
16. for i = 1 to counter
17. if students[i] > max then
18. max = students[i]; index = i;
19. end for loop
20. Print the class number = index, enrollment = max
**Comment for any further queries.