15 mark question Flashcards
What is the Order
- DECLARE
- CONSTANT
- 0
- NEXT
- STUDENT COUNTER
- GRADE
- OUTPUT
DECLARE
- DECLARE TotalMark : ARRAY[1:50] OF INTEGER
- DECLARE AverageMark : ARRAY[1:50] OF INTEGER
- DECLARE SubjectCounter : INTEGER
- DECLARE StudentCounter : INTEGER
- DECLARE DistinctionNo : INTEGER
- DECLARE MeritNo : INTEGER
- DECLARE PassNo : INTEGER
- DECLARE FailNo : INTEGER
CONSTANT
CONSTANT Distinction = 70
CONSTANT Merit = 55
CONSTANT Pass = 40
0
DistinctionNo ← 0
MeritNo ← 0
PassNo ← 0
FailNo ← 0
NEXT
FOR StudentCounter ← 1 to ClassSize
TotalMark[StudentCounter] ← 0
NEXT StudentCounter
FOR StudentCounter ← 1 to ClassSize
FOR SubjectCounter ← 1 to SubjectNo
TotalMark[StudentCounter] ← TotalMark[StudentCounter] + StudentMark[StudentCounter,
SubjectCounter]
NEXT SubjectCounter
AverageMark[StudentCounter] ← INT((TotalMark[StudentCounter] / SubjectNo) + 0.5)
STUDENT COUNTER
OUTPUT “Name “, StudentName[StudentCounter]
OUTPUT “Combined total mark “, TotalMark[StudentCounter]
OUTPUT “Average mark “, AverageMark[StudentCounter]
GRADE
IF AverageMark[StudentCounter] >= Distinction
THEN
DistinctionNo ← DistinctionNo + 1
OUTPUT “Grade Distinction”
ELSE
IF AverageMark[StudentCounter] >= Merit
THEN
MeritNo ← MeritNo + 1
OUTPUT “Grade Merit”
ELSE
IF AverageMark[StudentCounter] >= Pass
THEN
PassNo ← PassNo + 1
OUTPUT “Grade Pass”
ELSE
FailNo ← FailNo + 1
OUTPUT “Grade Fail”
ENDIF
ENDIF
ENDIF
NEXT StudentCounter
OUTPUT
OUTPUT “Number of Distinctions “, DistinctionNo
OUTPUT “Number of Merits “, MeritNo
OUTPUT “Number of Passes “, PassNo
OUTPUT “Number of Fails “, FailNo