All variables, constants and other identifiers should have meaningful names.
Did this page help you?
All variables, constants and other identifiers should have meaningful names.
Did this page help you?
The pseudocode algorithm shown has been written by a teacher to enter marks for the students in her class and then to apply some simple processing.
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] >= 70
THEN
Grade[Count] ← "A"
ELSE
IF Score[Count] >= 60
THEN
Grade[Count] ← "B"
ELSE
IF Score[Count] >= 50
THEN
Grade[Count] ← "C"
ELSE
IF Score[Count] >= 40
THEN
Grade[Count] ← "D"
ELSE
IF Score[Count] >= 30
THEN
Grade[Count] ← "E"
ELSE
Grade[Count] ← "F"
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30
Write the pseudocode to output the contents of the arrays Score[]
and Grade[]
along with suitable messages.
[3]
Did this page help you?
[3]
Did this page help you?
The 1D array StudentName[ ]contains the names of students in a class. The 2D array StudentMark[ ] contains the mark for each subject, for each student. The position of each student’s data in the two arrays is the same, for example, the student in position 10 in StudentName[ ]and StudentMark[ ]is the same.
The variable ClassSize contains the number of students in the class. The variable SubjectNo contains the number of subjects studied. All students study the same number of subjects.
The arrays and variables have already been set up and the data stored.
Students are awarded a grade based on their average mark.
Average mark | Grade awarded |
greater than or equal to 70 | distinction |
greater than or equal to 55 and less than 70 | merit |
greater than or equal to 40 and less than 55 | pass |
less than 40 | fail |
Write a program that meets the following requirements:
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to initialise the data in the array.
[15]
Did this page help you?