برنامه اي تهيه كنيد كه اعمال رياضي يك دانش آموزرا براي او انجام مي دهد . اعمالي چون چهار عمل اصلي ، به توان رساندن ، جذر گرفتن و غيره
کد:
REM program to calculate
کد:
PRINT " IF you want TO addition numbers”;
PRINT “and to SUBSTRAC numbers”;
PRINT “and to Multiple numbers”;
PRINT “and to Divide and to Square root numbers”;
INPUT “Enter your operation”; op$
IF OP$ = “ADD” THEN
INPUT “Enter two number for addition”; a , b
LET c = a + b
PRINT “the result is”; c
ELSEIF OP $ = “Sub” THEN
INPUT “Enter two number for Subtract”; a , b
LET c = a – b
PRINT “the result is”; c
ELSEIF OP $ = “mul” THEN
INPUT “Enter two number for multiple”; a , b
LET c = a * b
PRINT “the result is”; c
ELSEIF OP $ = “div” THEN
INPUT “Enter two number for divide”; a ,b
LET c = a / b
PRINT “the result is”; c
ELSEIF OP $ = “sqr” THEN
INPUT “Enter a number for square root”; a
LET b = SQR (a)
PRINT “the result is”; b
ELSE
PRINT “I cannot calculate!”
END IF
END