First Of all, we’d write down the scoring and grading system used by the school. The example below is used by Foodtech Building School (FBS).
Score Range (%)
|
Grade
|
Score Range (%)
|
Grade
|
|
75 – 100
|
A1
|
40 – 44
|
D2
|
|
70 – 74
|
A2
|
35 – 39
|
E1
|
|
65 – 69
|
B1
|
30 – 34
|
E2
|
|
60 – 64
|
B2
|
25 – 29
|
G1
|
|
55 – 59
|
C1
|
20 – 24
|
G2
|
|
50 – 54
|
C2
|
0 – 19
|
F
|
|
45 – 49
|
D1
|
No Entry
|
NE
|
|
Sick
|
SS
|
REM Program to input score and compute grade
REM using SELECT CASE… END SELECT structure
CLS
DIM Score AS INTEGER, Grade AS STRING
INPUT “Please Enter Student’s Score Here: “, Score
SELECT CASE (Score)
CASE 75 TO 100
Grade = “A1”
CASE 70 TO 74
Grade = “A2”
CASE 65 TO 69
Grade = “B1”
CASE 60 TO 64
Grade = “B2”
CASE 55 TO 59
Grade = “C1”
CASE 50 TO 54
Grade = “C2”
CASE 45 TO 49
Grade = “D1”
CASE 40 TO 44
Grade = “D2”
CASE 35 TO 39
Grade = “E1”
CASE 30 TO 34
Grade = “E2”
CASE 25 TO 29
Grade = “G1”
CASE 20 TO 24
Grade = “G2”
CASE 0 TO 19
Grade = “F: Student might have fallen sick (SS)”
CASE ELSE
Grade = “Invalid Score: No Entry (NE)”
END SELECT
PRINT “The Student’s Score Is: “; Score
PRINT “The Student’s Grade Is: “; Grade
END
See the Output Image below:
Awesome.
Awesome.