Magnus Okeke

Product Manager, Content Creator, Customer Support

A QBasic Program To Input The Scores And Compute Grades Of Students

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
Then Program Code Below!….

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
PRINT “The Student’s Score Is: “; Score
PRINT
PRINT “The Student’s Grade Is: “; Grade
END

See the Output Image below:

QBasic Program
If you have suggestions, contributions or corrections, kindly leave a comment! Thank you
A QBasic Program To Input The Scores And Compute Grades Of Students
Interesting? Please share

Comments

comments

Only the best Content!

Receive new posts on investment, DIY, and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

2 thoughts on “A QBasic Program To Input The Scores And Compute Grades Of Students

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to top

Check out my YouTube videos

X