QBasic Iseng

DIM pengirim AS STRING
DIM penerima AS STRING
DIM berpak AS INTEGER
DIM tujuan AS STRING
DIM total AS INTEGER
DIM digit AS STRING
DIM nopak AS STRING
LET nopak = “123-45-”
LET p$ = “Pakaian”
LET d$ = “Dokumen”
LET m$ = “Makanan”
LET perkg = 5000
LET adm = 2000

‘program begin
1 CLS
PRINT “Selamat Datang di Pengiriman Kilat”
PRINT
PRINT “Apa yang ingin anda kirim ?”
PRINT
PRINT “A. Pakaian”
PRINT “B. Dokumen”
PRINT “C. Makanan”
PRINT
5 INPUT “Ketikkan Kode (A/B/C)”; jenbar$
jenbar$ = UCASE$(jenbar$)
SELECT CASE jenbar$
CASE “A”
CLS : PRINT “Anda Akan Mengirim “; p$
CASE “B”
CLS : PRINT “Anda Akan Mengirim “; d$
CASE “C”
CLS : PRINT “Anda Akan Mengirim “; m$
END SELECT

GOTO 40

‘pengirim & penerima

40 PRINT : INPUT “Masukkan Nama Penerima : “, penerima
INPUT “Masukkan Tujuan Kota Penerima : “, tujuan
INPUT “Masukkan 3 Digit Angka : “, digit
digit = LEFT$(digit, 3)
SLEEP 1
PRINT
INPUT “Masukkan Nama Pengirim : “, pengirim
INPUT “Masukkan kota Pengirim : “, kotapengirim$
SLEEP 1
GOTO 50

‘penghitungan ongkir
50 CLS : PRINT “—SILAHKAN TIMBANG BERAT PAKET ANDA—”
PRINT
INPUT “Tuliskan Berat Paket Anda (dalam kg) “, berpak
SLEEP 1
IF berpak >= 40 THEN
total = berpak * (perkg + 100) + adm: GOTO 100
ELSEIF berpak >= 20 THEN
total = berpak * (perkg + 50) + adm: GOTO 100
ELSEIF berpak >= 1 THEN
total = berpak * perkg + adm: GOTO 100
END IF

‘rincian pengiriman
100 CLS : PRINT “<<<<RINCIAN PENGIRIMAN>>>>”
PRINT
IF jenbar$ = “A” THEN
jenbar$ = p$
ELSEIF jenbar$ = “B” THEN
jenbar$ = d$
ELSEIF jenbar$ = “C” THEN
jenbar$ = m$
END IF
PRINT “—mohon tunggu hingga rincian selesai—”
PRINT
SLEEP 1
PRINT “pengirim : “; pengirim
SLEEP 1
PRINT “penerima : “; penerima
SLEEP 1
PRINT “jenis barang : “; jenbar$
SLEEP 1
PRINT “tujuan : “; tujuan
SLEEP 1
PRINT “no. paket : “; nopak + digit
SLEEP 1
PRINT “total biaya :”; total
SLEEP 2
PRINT
PRINT TAB(15); “|”; STRING$(34, “=”); “|”
PRINT TAB(15); “|tekan Y untuk kembali ke menu awal”; “|”
PRINT TAB(15); “|”; STRING$(34, “=”); “|”
PRINT
PRINT
INPUT “kirim lagi ? (Y/T) “; kirim$
IF UCASE$(kirim$) = “Y” THEN : SLEEP 1: GOTO 1 ELSE END

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s