QBASIC PROGRAMMING (Short Answer)

Document Sample
QBASIC PROGRAMMING (Short Answer) Powered By Docstoc
					Cjf/SMRimba/QBASIC Programming/Short Answer                      1


           QBASIC PROGRAMMING (Short Answer)

CLS
COLOR 2, 9
LOCATE 5, 19
PRINT "REVISION QUESTIONS ON COMPUTER STUDIES"
COLOR 3, 5
LOCATE 7, 26
PRINT "When a question is asked"
LOCATE 8, 27
PRINT "you are given only one try"
LOCATE 9, 26
PRINT "to answer it correctly."
COLOR 5, 2
LOCATE 11, 9
PRINT "You score 4 points if you answer correctly"
LOCATE 14, 16
PRINT "Please use upper case letters for your answers."
COLOR 1, 11
LOCATE 16, 26
PRINT "This program is written by"
LOCATE 17, 32
PRINT "CHONG JON FONG"
LOCATE 19, 23
PRINT "To run the program again, press F5"
PRINT
COLOR 2, 0
LOCATE 23, 32
PLAY "E D C D E E L2E L4D D L2D L4E G L2G"
PRINT TAB(10); "Press <Ctrl> <Break> to terminate the program"
PRINT
INPUT "Press enter to proceed"; e$
PRINT
PRINT

LET T = 0
FOR N = 1 TO 10
READ Q$, A$
PRINT Q$
LET S = 4
INPUT B$
        IF B$ <> A$ THEN
        PRINT " SORRY YOUR ANSWER IS WRONG!"
        PLAY "G"
        ELSE PRINT " WELL DONE"
        BEEP
        LET T = T + S
        END IF
Cjf/SMRimba/QBASIC Programming/Short Answer                      2

PRINT
PRINT " THE CORRECT ANSWER IS "; A$
PRINT
PRINT " YOUR SCORE IS "; T
PRINT
NEXT N
PRINT
PRINT "YOUR FINAL SCORE IS "; T
PRINT "OUT OF A MAXIMUM OF 40"
PRINT

COLOR 4, 2
IF T = 40 THEN
PRINT "   CONGRATULATIONS, YOU WIN A PRIZE !!! "
PLAY "CCCC"
END IF
PRINT
COLOR 5, 11
PRINT "BYE, THANK YOU FOR USING THIS PROGRAM"


DATA 1. _________ ARE USED TO CONNECT FLOWCHART SYMBOLS.
,"FLOWLINES"
DATA 2. A SET OF INSTRUCTIONS IS CALLED __________. , "PROGRAM"
DATA 3. THE PRINTER OUTPUT IS KNOWN AS __________. , "HARD COPY"
DATA 4. THE PROGRAM WRITTEN IN ANY ONE OF THE PROGRAMMING
LANGUAGUES IS ________., "SOURCE CODE"
DATA 5. THE PROCESS OF CHANGING THE APPEARENCE OF A TEXT DOCUMENT
IS KNOWN AS _______. , "FORMATTING"
DATA 6. A GRAPHICAL REPRESENTATION OF A ROUTINE IS CALLED _______.
, "FLOWCHART"
DATA 7. THE MOTHER TONGUE OF A COMPUTER IS ________., "MACHINE
LANGUAGE"
DATA 8. A MACHINE LANGUAGUE PROGRAM IS WRITTEN IN
_________________. , "MACHINE CODE"
DATA 9. THE LETTER CODES USED IN ASSEMBLY LANGUAGUES IS CALLED
_______., "MNEMONICS"
DATA 10. REMOVING AN ERROR FROM A PROGRAM IS KNOWN AS _______.,
"DEBUGGING"