QBasic Programming

WAP to supply percentage from the keyboard and print division using sub – program. Use the following conditions

Percentage                                Division
Per <40                                     Fail
Per>=40 and P<50                     Third
Per>=50 and P<60                     Second
Per>=60 and P<80                     First
Per>=80 and P<100                   Distinction


CLS
INPUT “ENTER PERCENTAGE”; P
IF P>=80 AND P<=100 THEN
PRINT “DIVISION”
ELSEIF P>=60 AND P<80 THEN
PRINT “FIRST DIVISION”
ELSEIF P>=50 AND P<60 THEN
PRINT “SECOND DIVISION”
ELSEIF P>=40 AND P<50 THEN
PRINT “THIRD DIVISION”
ELSEIF P>=0 AND P<40 THEN
PRINT “FAIL”
ELSE
PRINT “PLEASE ENTER THE NUMBER BETWEEN 0 TO 100”
END IF

In order to discourage heavy consumption of electricity, the electricity board charges the following rates (Prev Lesson)
(Next Lesson) WAP to display all natural numbers from 1 to 100
Back to QBasic Programming

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!