Selasa, 15 November 2011

LA Q-Basic III (Last)

10 CLS
COLOR 15
DIM a AS INTEGER
PRINT ; "--------MENU--------"
PRINT
PRINT ; "1. Program Biodata"
PRINT ; "2. Program For-Next"
PRINT ; "3. Program Do Until"
PRINT ; "4. Program Do While"
PRINT ; "5. EXIT"
PRINT
PRINT ; "--------------------"
INPUT "Masukan Angka : ", a
SELECT CASE a
CASE 1
CLS
PRINT "Program Biodata"
PRINT "---------------"
PRINT
INPUT "Masukan Nama Anda  : ", nama$
INPUT "Masukan Kelas Anda : ", kelas$
INPUT "Masukan NPM Anda   : ", npm$
CLS
PRINT "BIODATA ANDA"
PRINT "------------"
PRINT
PRINT "Nama Anda : "; nama$
PRINT "Kela Anda : "; kelas$
PRINT "NPM Anda  : "; npm$
20 LOCATE 25, 80
INPUT "", p
CLS
INPUT "Tekan Enter untuk kembali ke menu !", o
GOTO 10
END

CASE 2
CLS
PRINT "Program FOR - NEXT"
PRINT "------------------"
PRINT
INPUT "Masukan Angka : ", b%
PRINT
FOR n = 1 TO b%
FOR m = 1 TO n
PRINT ""; m;
NEXT m
PRINT
NEXT n
PRINT
GOTO 20
CASE 3
CLS
PRINT "Program Do Until"
PRINT "----------------"
PRINT
INPUT "Masukan Angka : ", z%
PRINT
DO
LET z% = z% * 3
PRINT z%;
LOOP UNTIL z% >= 100
PRINT
PRINT
PRINT
GOTO 20
CASE 4
CLS
PRINT "Proram Do While"
PRINT "---------------"
PRINT
INPUT "Masukan Angka : ", x%
PRINT
DO WHILE x% >= 1
x% = x% - 2
PRINT x%;
LOOP
PRINT
PRINT
PRINT
GOTO 20
CASE 5
CLS
LOCATE 5, 33
PRINT "SAYONARA (^_^)"
PRINT
END
CASE ELSE
GOTO 10
END SELECT

OUTPUT :

1 komentar:

Putra's Shirou mengatakan...

Bisa ko...
klo langsung d'copas....

Posting Komentar

 
;