Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
64 views3 pages

StudentNames - 15marks

The program calculates student marks and grades for a class. It uses arrays to store student names and marks for multiple subjects. It calculates the total and average mark for each student, determines the grade based on the average, and outputs the student results. It also calculates and outputs the number of students who received each grade.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views3 pages

StudentNames - 15marks

The program calculates student marks and grades for a class. It uses arrays to store student names and marks for multiple subjects. It calculates the total and average mark for each student, determines the grade based on the average, and outputs the student results. It also calculates and outputs the number of students who received each grade.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

13 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

 greater than or equal to 70


 greater than or equal to 55 and less than 70
 greater than or equal to 40 and less than 55
 less than 40

Grade awarded

 distinction
 merit
 pass
 fail

Write a program that meets the following requirements:

• calculates the combined total mark for each student for all their subjects

• calculates the average mark for each student for all their subjects, rounded to the nearest whole
number

• outputs for each student:

 name
 combined total mark
 average mark
 grade awarded

calculates, stores and outputs the number of distinctions, merits, passes and fails for the whole class

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.


Arrays

StudentNames[]

Index StudentName[]
0 Pearl
1 Reene
2 Ellet
3 Mufaro
4 Onye
5 Tadi
6 Tari
7 Clara
8 Tanya
9 Pinky

StudentMarks[]

Index Maths Accounts English Geo


0 1 2 3
0 100 50 70 80
1 91 71 61 100
2 81 100 95 60
3 70 60 50 40
4 100 88 95 70
5 100 100 100 100
6 90 90 90 90
7 100 80 90 100
8 14 12 28 35
9 100 99 87 89

START

DECLARE StudentName : ARRAY[0 TO 9] OF STRING ={“Pearl”, “Reene”, “Ellet”, “Mufaro”, “Onye”,


“Tadi”, “Tari”, “Clara”, “Tanya”, “Pinkie”}

DECLARE StudentMarkR : ARRAY[0 TO 9, 0 TO 3] OF INTEGER={(100,50,70,80),(91,71,61,100),


(81,100,95,60),(70,60,50,40),(100,88,95,70),(100,100,100,100),(90,90,90,90),(100,80,90,100),
(14,12,28,35),(100,99,87,89)

DECLARE ClassSize : INTEGER = 10

DECLARE SubjectNo : INTEGER=4

DECLARE TotalMark, DistinctionCount, MeritCount, PassCount, FailCount, RowCount,


ColCount :INTEGER

DECLARE AverageMark : REAL

DECLARE GradeAwarded : STRING

TotalMark0
AverageMark0

FOR RowCount0 TO 9

FOR ColCount0 TO 3

TotalMarkTotalMark+StudentMark(RowCount,ColCount)

NEXT ColCount

AverageMarkINT(TotalMarks/SubjectNo)

CASE AverageMark OF:

70 TO 100:

GradeAwarded “Distinction”

DistinctionCountDistinctionCount+1

55 TO 69:

GradeAwarded”Merit”

MeritCountMeritCount+1

40 TO 54:

GradeAwarded”Pass”

PassCountPassCount+1

0 TO 39:

GradeAwarded”Fail”

FailCountFailCount+1

ENDCASE

PRINT “Name: “, StudentName(RowCount)

PRINT “Combined total mark is: “, TotalMark

PRINT “Average mark”, AverageMark

PRINT “Grade: “, GradeAwarded

NEXT RowCount

PRINT “The number of Distinction: ”,DistinctionCount

PRINT “The number of Merits: “, MeritCount

PRINT “The number passes: “, PassesCount

PRINT “The number fails: “, FailCount

END

You might also like