Create a text file using Notepad and save it as "QLIST.TXT"
Question 1
Where is capital city of Nepal ?
A) Kathmandu
B) Pokhara
C) Janakpur
D) Butwal
A
Question 2
Polulation of Nepal - Census 2078 ?
A) 29192485
B) 29192481
C) 29192480
D) 29192479
C
Remeber in your text file cursor must stop after the correct ans of last question to avoid the error "Input past end of file".
Where is capital city of Nepal ?
A) Kathmandu
B) Pokhara
C) Janakpur
D) Butwal
A
Question 2
Polulation of Nepal - Census 2078 ?
A) 29192485
B) 29192481
C) 29192480
D) 29192479
C
Make a QBASIC file with following codes.
PRINT "QUIZ USING QBASIC"
PRINT "Quiz downloaded from PLK computer SIR Blog"
OPEN "QLIST.TXT" FOR INPUT AS #1
SCORE = 0
WHILE NOT EOF(1)
INPUT #1, QN$
PRINT QN$
INPUT #1, QUESTION$
PRINT QUESTION$
INPUT #1,A$
PRINT A$
INPUT #1,B$
PRINT B$
INPUT #1,C$
PRINT C$
INPUT #1,D$
PRINT D$
INPUT #1,CA$
INPUT "ENTER YOUR ANS : ";UANS$
IF CA$=UANS$ THEN
PRINT "CORRECT ANS"
SCORE = SCORE + 1
PRINT "YOUR SCORE IS ";SCORE
ELSE
PRINT "SORRY ! CORRECT ANS WAS ";CA$
PRINT "YOUR SCORE IS ";SCORE
END IF
PRINT "PRESS ANY KEY TO CONTINUE"
WHILE INKEY$=""
WEND
WEND
CLOSE #1
CLS
PRINT "QUIZ OVER"
PRINT "YOUR FINAL SCORE IS";SCORE
END