Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

1.

10 CLS
20 PRINT "Hello World!"

----------------------------------------------------------------------------------------------------------------------------------------------------------------
2.
10 CLS
20 INPUT "What is your name?"; a
30 PRINT "Hello, "; a; ", I am your computer.”

----------------------------------------------------------------------------------------------------------------------------------------------------------------
3.
10 CLS
20 INPUT "What is Your Name?"; a
30 IF a = "Alice" THEN GOTO 50 ELSE GOTO 40
40 IF a = "Bob" THEN GOTO 50 ELSE GOTO 60
50 PRINT "Hello " + a
60 END

----------------------------------------------------------------------------------------------------------------------------------------------------------------
4.
10 CLS
11 INPUT "Choose Any Number!"; a
20 FOR I = 1 TO a
30 LET X = X + I
40 NEXT I
50 PRINT X

----------------------------------------------------------------------------------------------------------------------------------------------------------------
5.
10 CLS
11 INPUT "Choose Any Number!"; a
20 FOR I = 1 TO a
21 IF I % 3 = 0 OR I % 5 = 0 THEN GOTO 30 ELSE GOTO 40
30 LET X = X + I
40 NEXT I
50 PRINT X

----------------------------------------------------------------------------------------------------------------------------------------------------------------
6.
5 CLS
10 INPUT "Pick a Number, Any Number."; a
20 INPUT "Would you like the Sum or the Product of Your Number?"; b
30 IF b = "Sum" then GOTO 50
40 IF b = "Product" then GOTO 100
50 FOR x = 1 to a
60 LET d = d + x
80 NEXT x
85 PRINT "The Sum Is "; d
90 END
100 LET c = 1
110 FOR y = 1 to a
120 LET c = c * y
130 NEXT y
140 PRINT "The Product Is " + c
150 END
----------------------------------------------------------------------------------------------------------------------------------------------------------------
7.
10 CLS
20 FOR x = 1 TO 12
30 FOR y = 1 TO 12
40 LET a = x * y
50 PRINT a
60 NEXT y
70 NEXT x
80 END

----------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------------------------------------------------
9.
10 CLS
20 LET y = 56
30 INPUT "Guess The Number! (1-100)"; a
40 IF a > y THEN GOTO 70
50 IF a < y THEN GOTO 80
60 IF a = y THEN GOTO 90

70 PRINT "Too High"


71 LET x = x + 1
72 PAUSE 500
73 GOTO 30

80 PRINT "Too Low"


81 LET x = x + 1
82 PAUSE 500
83 GOTO 30

90 PRINT "Just Right"


91 LET x = x + 1
92 PRINT "Tries: " + X
93 END

----------------------------------------------------------------------------------------------------------------------------------------------------------------
10.
10 CLS
20 PRINT "The Next 20 Leap Years Are"
30 PRINT " "
40 A = 2020
50 DO WHILE A < 2100
60 PRINT A
70 A = A + 4
80 LOOP

You might also like