QBASIC PROGRAM TO INPUT QUATITY AND RATE OF PEN ,COPY AND PENCIL AND CALCULATE TOTAL AMOUNT
CLS
INPUT “ENTER QUANTITY OF PEN”;QP
INPUT “ENTER RATE OF PEN”; RP
INPUT “ENTER QUANTITY OF COPY”; QC
INPUT “ENTER RATE OF COPY”; RC
INPUT “ENTER QUANTITY OF PENCIL”; QPC
INPUT” ENTER RATE OF PENCIL”; RPC
TA = (QP * RP) + (QC * RC) + (QPC * RPC)
PRINT “TOTAL AMOUNT =”; TA
END
USING SUB
DECLARE SUB COST()
CLS
CALL COST
END
SUB COST
INPUT “ENTER QUANTITY OF PEN”;QP
INPUT “ENTER RATE OF PEN”; RP
INPUT “ENTER QUANTITY OF COPY”; QC
INPUT “ENTER RATE OF COPY”; RC
INPUT “ENTER QUANTITY OF PENCIL”; QPC
INPUT” ENTER RATE OF PENCIL”; RPC
TA = (QP * RP) + (QC * RC) + (QPC * RPC)
PRINT “TOTAL AMOUNT =”; TA
END SUB
0 Comments