QBASIC PROGRAM TO CALCULATE COST OF PAINTING THE FOUR WALLS OF A ROOM
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
INPUT “ENTER COST OF A PAINTING”; C
A = 2 * H * (L + B)
T = C * A
PRINT “COST OF PAINTING A ROOM“; T
END
USING SUB
DECLARE SUB COST(L,B,H)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
CALL COST(L,B,H)
END
CALL COST(L,B,H)
INPUT “ENTER COST OF A PAINTING”; C
A = 2 * H * (L + B)
T = C * A
PRINT “COST OF PAINTING A ROOM“; T
END SUB
0 Comments