REM FACE DRAW
CLS
5 FOR Q = 1 TO 2
20 PLAY “AB”
40 SCREEN 1
50 CIRCLE (100, 100), 100
60 CIRCLE (70, 80), 20
70 PAINT (70, 78), 20
80 CIRCLE (120, 78), 20
90 PAINT (120, 80), 20
110 CIRCLE (100, 120), 30
120 CIRCLE (100, 160), 15
121 PRINT “YOU ARE GOOD”
122 NEXT Q
123 SCREEN 2
124 FOR I = 1 TO 100
125 CIRCLE (100 + I, 100), 300
126 CIRCLE (100 + I, 100), 159
127 NEXT I
128 PRINT “WE HOPE YOU LIKED THIS”
130 END
Category: Basic Programs, Computer Programs
REM INCOMPLETE..MERGE EMPLOYEE CODE TO PREVIOUS PROGRAMME
CLS
INPUT “ENTER NO OF EMPLOYEE”; N
FOR I = 1 TO N
INPUT “ENTER EMLOYEE NAME “; E$
INPUT “ENTER EMPLOYEE CODE”; C
BASIC = 1600
DA = 170 / 100 * 1600
HRA = 10 / 100 * 1600
T = BASIC + DA + HRA
PRINT ” NAME …..”; E$
PRINT “CODE….”; C
PRINT “TOTAL….”; T
NEXT I
END
Category: Basic Programs, Computer Programs
REM THIS PROGRAMME INPUTS EMPLOYEE’S NAME AND CALCULATES SALARY AS PER GREADE
CLS
10 INPUT “ENTER THE NO OF EMP”; N
20 FOR I = 1 TO N
30 INPUT “ENTER THE NAME OF EMP”; S$
40 INPUT “ENTER THE GRADE”; G
50 ON G GOTO 60, 80, 100
60 BASIC = 1600
70 GOTO 110
80 BASIC = 2400
90 GOTO 110
100 BASIC = 3200
110 DA = 70 / 100 * BASIC
120 HRA = 50 / 100 * BASIC
130 TOTAL = DA + HRA + BASIC
140 PRINT “TOTAL SALARY”; TOTAL
150 NEXT I
160 END
Category: Basic Programs, Computer Programs
REM THIS PROGRAMM COMPARES TWO NUMBERS. “=” NOT TOLD IN CLASS?
CLS
10 : INPUT “ENTER THE FIRST NO Q”; Q
20 : INPUT “ENTER THE SECOND NO W”; W
30 : IF Q > W THEN 40 ELSE 60
40 : PRINT “Q >W”
50 : GOTO 70
60 : IF Q = W THEN 65 ELSE 66
65 : PRINT “W=Q”
67 : GOTO 70
66 : PRINT “Q<W”
70 : END
Category: Basic Programs, Computer Programs
REM THIS PROGRAMME TELLS HOW MANY TIMES A CHAR REPEATS IN A STRING
CLS
COUNT = 0
INPUT “ENTER ANY STRING”; N$
INPUT “ENTER ANY CHARACTER”; A$
L = LEN(N$)
FOR T = 1 TO L
LET S$ = MID$(N$, T, 1)
IF S$ = A$ THEN COUNT = COUNT + 1
NEXT T
PRINT “TOTAL NO OF OCCURENCE OF “; A$; ” IS”; COUNT; “times”
END
Category: Basic Programs, Computer Programs
REM TAKE INPUTS AND ADD THEM AND PRINT THEM
CLS
INPUT “ENTER NO OF STUDENT “; Q
FOR I = 1 TO Q
INPUT “ENTER STUDENT NAME”; W$
INPUT “ENTER COST OF FOOD”; F
INPUT “ENTER COST OF ACCOMADITION”; A
INPUT “ENTER COST OF TRAVELLING”; T
E = F + A + T
PRINT “FOOD….”; F
PRINT “ACOMADITION….”; A
PRINT “TRAVELLING….”; T
PRINT “TOTAL….”; E
NEXT I
END
Category: Basic Programs, Computer Programs
REM NOTE HOW GOSUB TAKES TO A DIFF PROGRAMME AND RETURN BRINGS IT BACK
CLS
10 INPUT “ENTER ANY NUM”; A
20 INPUT “ENTER ANY NUM”; B
30 INPUT “ENTER ANY VALUE “; C
40 GOSUB 100
50 PRINT “C1:SUM OF THREE NUMBERS IS”; C1
60 PRINT “C2:SUM OF THE SQUARES OF THREE NUMBERS IS “; C2
70 PRINT “C3:SUM OF THE CUBES OF THREE NUMBERS”; C3
80 END
100 LET C1 = A + B + C
110 LET C2 = A ^ 2 + B ^ 2 + C ^ 2
120 LET C3 = A ^ 3 + B ^ 3 + C ^ 3
130 RETURN
Category: Basic Programs, Computer Programs
INPUT “Average of how many numbers ? enter any number “; N
FOR I = 1 TO N
INPUT “ENTER THE NUMBER “; NUM
LET SUM = SUM + NUM
NEXT I
LET AVG = SUM / N
PRINT “AVERAGE”; AVG
END
REM INTERESTING…IF U DO NOT GIVE ANY NUMBER
Category: Basic Programs, Computer Programs
REM CALCULATE AND TELL AREA AND PERIMETER
INPUT “ENTER LENGTH=”; L
INPUT “ENTER BREADTH=”; B
PRINT ” MENU ”
PRINT ” 1. AREA OF RECTANGLE ”
PRINT ” 2. PERIMETER OF RECTANGLE ”
INPUT “ENTER YOUR CHOICE”; CHOICE
IF CHOICE = 1 THEN GOTO 10 ELSE GOTO 20
10 LET AREA = L * B
PRINT AREA: END
20 LET PERI = 2 * (L + B)
PRINT PERI
END
Category: Basic Programs, Computer Programs
CLS
INPUT “YOUR FIRST NAME ?”; A$
INPUT “YOUR MIDDLE NAME ?”; B$
INPUT “YOUR SURNAME ?”; C$
D$ = LEFT$(A$, 1) + “.”
E$ = LEFT$(B$, 1) + “.”
F$ = D$ + E$ + C$
PRINT “YOUR SHORT NAME IS “; F
END
Category: Basic Programs, Computer Programs
Recent Comments