0% found this document useful (0 votes)
26 views2 pages

Assignment 3

Uploaded by

Nandhini S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Assignment 3

Uploaded by

Nandhini S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BEGIN

DECLARE totalStudents, totalSubjects, countStudents, countSubjects

DECLARE grade, sum, average

DISPLAY "Welcome to Student Grading System"

INPUT "Enter the total number of students: "

INPUT totalStudents

countStudents = 1

WHILE countStudents <= totalStudents

sum = 0

DISPLAY "Enter the total number of subjects for student ", countStudents

INPUT totalSubjects

countSubjects = 1

WHILE countSubjects <= totalSubjects

DISPLAY "Enter grade for subject ", countSubjects

INPUT grade

IF grade < 0 OR grade > 100

DISPLAY "Invalid grade entered. Grade should be between 0 and 100."


CONTINUE

END IF

sum = sum + grade

countSubjects = countSubjects + 1

END WHILE

average = sum / totalSubjects

IF average >= 90

DISPLAY "Grade for student ", countStudents, ": A"

ELSE IF average >= 80

DISPLAY "Grade for student ", countStudents, ": B"

ELSE IF average >= 70

DISPLAY "Grade for student ", countStudents, ": C"

ELSE IF average >= 60

DISPLAY "Grade for student ", countStudents, ": D"

ELSE

DISPLAY "Grade for student ", countStudents, ": F"

END IF

countStudents = countStudents + 1

END WHILE

END

You might also like