Write a QBASIC program to grade any score entered from the keyboard as either "Poor" for a score that is below 50% or "Satisfactory" for a score that is equ...

Assessment: WAEC SSCE - Computer Studies - 2021 (Essay) Subject: Computer Studies

Question 1 Report

Write a QBASIC program to grade any score entered from the keyboard as either "Poor" for a score that is below 50% or "Satisfactory" for a score that is equal to or above 50%. The program execution should stop as soon as a score that is less than zero is entered.

Answer Details

QBASIC program to grade a score as "Poor" or "Satisfactory"

The program keeps asking for a score. If the score entered is less than zero, it stops immediately. Otherwise it prints "Poor" for a score below 50 and "Satisfactory" for a score of 50 or above.

REM Program to grade scores
CLS
DO
    INPUT "Enter a score (negative to stop): ", SCORE
    IF SCORE < 0 THEN
        EXIT DO
    END IF
    IF SCORE < 50 THEN
        PRINT "Poor"
    ELSE
        PRINT "Satisfactory"
    END IF
LOOP
END

How it works:

  • The DO ... LOOP repeats so that many scores can be graded one after another.
  • INPUT reads a score from the keyboard.
  • If SCORE < 0, the EXIT DO statement ends the loop and the program stops.
  • The IF ... ELSE statement tests the score: below 50 prints Poor; equal to or above 50 prints Satisfactory (since 50% is the boundary and belongs to Satisfactory).

Alternative using GOTO (also acceptable):

CLS
Start:
INPUT "Enter a score: ", SCORE
IF SCORE < 0 THEN END
IF SCORE < 50 THEN PRINT "Poor" ELSE PRINT "Satisfactory"
GOTO Start

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning