Senin, 31 Oktober 2011

Tugas LA Q-Basic

Proram Biodata
CLS
DIM k AS STRING
DIM n AS STRING
DIM m AS STRING
PRINT "Masukan Biodata Anda"
PRINT "*****************"
PRINT
INPUT "Masukan nama anda : ",k
INPUT "Masukan NPM anda : ",n
INPUT "Masukan kelas anda : ",m
CLS
PRINT "BIODATA ANDA"
PRINT "***********"
PRINT
PRINT "Nama Anda : ";k
PRINT "NPM Anda : ";n
PRINT "Kelas Anda : ",m
END




Program Menghitung Luas Persegi
CLS
DIM s AS INTEGER
PRINT "================================================="
PRINT "Menghitung Luas Persegi"
PRINT "================================================="
PRINT
INPUT "Masukan Sisi : ", s
LET l = s * s
PRINT "Luas Persegi :"; l
END


OUTPUT :


Program Menghitung Luas Persegi Panajng

CLS
DIM p AS INTEGER
DIM l AS INTEGER
DIM luas AS DOUBLE
PRINT "================================================="
PRINT "Menghitung Luas Persegi Panjang"
PRINT "================================================="
PRINT
INPUT "Masukan Panjang : ", p
INPUT "Masukan Lebar      : ", l
LET luas = p*l
PRINT
PRINT "Luas Persegi Panjang : "; luas
END

OUTPUT :




Program Menghitung Luas Lingkaran
CLS
DIM r AS INTEGER
PRINT "================================================="
PRINT "Menghitung Luas dan Keliling Linkaran"
PRINT "================================================="
PRINT
LOCATE ,2
INPUT "Masukan Jari - Jari : ", r
LET luas = 3.14*r*r
LET keliling = 2*3.14*r
PRINT
PRINT "Luas Lingkaran : "; luas
PRINT "Keliling Lingkaran : "; keliling
END

OUTPUT :




Program Menghitung Volume Kubus
CLS
DIM s AS INTEGER
PRINT "================================================="
PRINT "Menghitung Volume Kubus"
PRINT "================================================="
PRINT
INPUT "Masukan Sisi : ", s
LET l = s * s * s
PRINT "Volume Kubus :"; l
END

OUTPUT :



Program Menghitung Volume Balok
CLS
DIM p AS INTEGER
DIM l AS INTEGER
DIM t AS INTEGER
PRINT ; "================================================="
PRINT ; "Menghitung Volume Balok"
PRINT ; "================================================="
PRINT
INPUT "Masukan Panjang : ", p
INPUT "Masukan Lebar   : ", l
INPUT "Masukan Tinggi  : ", t
LET luas = p * l * t
PRINT
PRINT "Panjang :"; p
PRINT "Lebar   :"; l
PRINT "Tinggi  :"; t
PRINT "Luas    :"; luas
END


OUTPUT :



Program MenghitungLuas Jajar-genjang
CLS
DIM a AS INTEGER
DIM t AS INTEGER
PRINT ; "================================================="
PRINT ; "Menghitung Luas Jajar-genjang"
PRINT ; "================================================="
PRINT
INPUT "Masukan Alas   : ", a
INPUT "Masukan Tinggi : ", t
LET la = a * t
PRINT
PRINT "Alas   :"; a
PRINT "Tinggi :"; t
PRINT "Luas   :"; la
END


OUTPUT :





Program Menghitung Volume Kerucut
CLS
DIM r AS INTEGER
DIM t AS INTEGER
PRINT ; "================================================="
PRINT ; "Menghitung Volume Tabung"
PRINT ; "================================================="
PRINT
INPUT "Masukan Jari-Jari  : ", r
INPUT "Masukan Tinggi     : ", t
LET la = 3.14 * r * r
LET v = (la * t)/3
PRINT
PRINT "Jari-jari :"; r
PRINT "Tinggi    :"; t
PRINT "Luas Alas :"; la
PRINT "Volume    :"; v
END


OUTPUT :



Program Menghitung Volume Tabung
CLS
DIM r AS INTEGER
DIM t AS INTEGER
PRINT ; "================================================="
PRINT ; "Menghitung Volume Tabung"
PRINT ; "================================================="
PRINT
INPUT "Masukan Jari-Jari  : ", r
INPUT "Masukan Tinggi     : ", t
LET la = 3.14 * r * r
LET v = la * t
PRINT
PRINT "Jari-jari :"; r
PRINT "Tinggi    :"; t
PRINT "Luas Alas :"; la
PRINT "Volume    :"; v
END


OUTPUT :












Program Menghitung Luas Segitiga
CLS
DIM a AS INTEGER
DIM t AS INTEGER
PRINT ; "================================================="
PRINT ; "Menghitung Luas Segitiga"
PRINT ; "================================================="
PRINT
INPUT "Masukan Alas   : ", a
INPUT "Masukan Tinggi : ", t
LET la = a * t/2
PRINT
PRINT "Alas   :"; a
PRINT "Tinggi :"; t
PRINT "Luas   :"; la
END


OUTPUT :

















Contoh Program Kondisi
CLS
DIM a AS INTEGER
PRINT "Contoh Program Kondisi"
PRINT "----------------------"
PRINT
PRINT
INPUT "Masukan Bilangan = ", a
IF a MOD 2 = 0 THEN 10
PRINT "Bilangan Ganjil"
GOTO 50
10 PRINT "Bilangan Genep"
50 END


OUTPUT :


0 komentar:

Posting Komentar

 
;