1.
classSize 10
2. numSubject 3
3. classTotal 0
4. FOR student 0 TO classSize-1 DO//to get marks from 10 students
a. subjectsTotal 0
b. FOR subject 0 TO numSubject -1 DO// to get individual subject mark; here is 3
c. OUTPUT “Please enter mark for subject ”, subject+1,”:”
d. INPUT mark
e. subjectsTotal subjectsTotal + mark // to sum up all subject marks for each
student
f. NEXT subject
g. OUTPUT “Total marks for student”,student+1,”:”,subjectsTotal
h. OUTPUT “Average mark for student”,student+1,”:”,subjectsTotal/numSubject
i. classTotal classTotal+subjectsTotal//totalling all students mark
5. NEXT student
6. OUTPUT “Total marks for all students: ”, classTotal
7. OUTPUT “Average mark for all students:”,classTotal/classSize
Nested loop: loop inside another loop: for/while/repeat-until