Soal no. 1
DIM absen , uts , uas AS SINGLE
DIM nakhir AS SINGLE
INPUT “Masukkan nilai absensi :";absen
INPUT “Masukkan nilai UTS :”;uts
INPUT “Masukkan nilai UAS :”;uas
Nakhir = (absen*0.1)+(uts*0.4)+(uas*0.5)
PRINT “Hasil nilai akhir anda : “;nakhir
END
DIM absen , uts , uas AS SINGLE
DIM nakhir AS SINGLE
INPUT “Masukkan nilai absensi :";absen
INPUT “Masukkan nilai UTS :”;uts
INPUT “Masukkan nilai UAS :”;uas
Nakhir = (absen*0.1)+(uts*0.4)+(uas*0.5)
PRINT “Hasil nilai akhir anda : “;nakhir
END
Soal 2
DIM pilih AS INTEGER
DIM a, t, s, r AS SINGLE
DIM luas AS SINGLE
CLS
PRINT "----MENU-----"
PRINT "1.SEGITIGA"
PRINT "2.KUBUS"
PRINT "3.LINGKARAN"
INPUT "Masukkan pilihan :"; pilih
IF pilih = 1 THEN
INPUT "Masukkan alas : "; a
INPUT "Masukkan tinggi : "; t
luas = 1 / 2 * a * t
PRINT "Luas segitiga = "; luas
ELSEIF pilih = 2 THEN
INPUT "Masukkan panjang rusuk :"; s
luas = s * s * 6
PRINT "Luas Kubus = "; luas
ELSEIF pilih = 3 THEN
INPUT "Masukkan panjang jari-jarinya :"; r
luas = 22 / 7 * r ^ 2
PRINT "Luas lingkaran = "; luas
ELSE
PRINT "Tidak ada pada pilihan "
END IF
END
DIM pilih AS INTEGER
DIM a, t, s, r AS SINGLE
DIM luas AS SINGLE
CLS
PRINT "----MENU-----"
PRINT "1.SEGITIGA"
PRINT "2.KUBUS"
PRINT "3.LINGKARAN"
INPUT "Masukkan pilihan :"; pilih
IF pilih = 1 THEN
INPUT "Masukkan alas : "; a
INPUT "Masukkan tinggi : "; t
luas = 1 / 2 * a * t
PRINT "Luas segitiga = "; luas
ELSEIF pilih = 2 THEN
INPUT "Masukkan panjang rusuk :"; s
luas = s * s * 6
PRINT "Luas Kubus = "; luas
ELSEIF pilih = 3 THEN
INPUT "Masukkan panjang jari-jarinya :"; r
luas = 22 / 7 * r ^ 2
PRINT "Luas lingkaran = "; luas
ELSE
PRINT "Tidak ada pada pilihan "
END IF
END
Soal 3
FOR i = 1 TO 5
PRINT TAB(i);
FOR j = 1 TO 6 - i
PRINT "*";
NEXT j
PRINT
NEXT i
FOR i = 1 TO 4
PRINT TAB(5 - i);
FOR j = 1 TO i + 1
PRINT "*";
NEXT j
PRINT
NEXT i
END
FOR i = 1 TO 5
PRINT TAB(i);
FOR j = 1 TO 6 - i
PRINT "*";
NEXT j
NEXT i
FOR i = 1 TO 4
PRINT TAB(5 - i);
FOR j = 1 TO i + 1
PRINT "*";
NEXT j
NEXT i
END
No comments:
Post a Comment