QBasic Programming

Input sales amount and rate of commission then calculate commission and return nt sales. [ns=sa-c)

REM PROGRAM TO CALCULATE NET SALES
CLS
INPUT “ENTER SALES AMOUNT”; A
INPUT “ENTER COMMISSION RATE”; R
C = R / 100 * A
NS = A - C
PRINT “NET SALES=”; NS
END
USING SUB PROCEDURE
DECLARE SUB SALES(A, R)
CLS
INPUT “ENTER SALES AMOUNT”; A
INPUT “ENTER COMMISSION RATE”; R
CALL SALES (A, R)
END
SUB SALES(A, R)
C = R / 100 * A
NS = A - C
PRINT “NET SALES=”; NS : END SUB
USING FUNCTION PROCEDURE
DECLARE FUNCTION SALES(A, R)
CLS
INPUT “ENTER SALES AMOUNT”; A
INPUT “ENTER COMMISSION RATE”; R
PRINT “NET SALES=”; SALES (A, R)
END
FUNCTION SALES(A, R)
C = R / 100 * A
NS = A - C
SALES = NS
END FUNCTION

Calculate total saving of a man if he earns Rs. 10,000 per month and spends 20% on food, 15% on children’s education, 10% on entertainment and 20% on rent (Prev Lesson)
(Next Lesson) An organization pays its employees allowance at the rate of 10% of basic salary. WAP to input the salary of the employees and calculate the allowances
Back to QBasic Programming

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!