Assalamu'alaikum..
disini saya ingin berbagi kodingan aplikasi warteg sederhana dengan menggunakan bahasa pemrograman QBasic. semoga bermanfaat :)
Keep Learn, Keep Coding.. ! :D
rem database
data "Nasi Uduk",7000
data "Nasi Rawon",6000
data "Pecel Lele",6000
data "Sate",15000
data "Nasi Kunning",7000
data "Es Teh",2000
data "Jus Jeruk",5000
data "Kopi",3000
data "Wedang Jahe",6000
data "Es Kelapa Muda",15000
rem variable
DIM namabarang$(20)
DIM harga(20)
rem baca database
for a=1 to 10
read namabarang$(a),harga(a)
next a
cls
x:
cls
color 3
print" Warteg Bengkel Perut "
print
print
color 4
print " Menu Kami"
print
color 7
print "Menu Makanan Harga Menu Minuman Harga "
color 4
print "1.Nasi Uduk Rp 7000 6.Es Teh Rp 2000"
print "2.Nasi Rawon Rp 6000 7.Jeruk Rp 5000"
print "3.Pecel Lele Rp 6000 8.Kopi Rp 3000"
print "4.Sate Rp 15000 9.Wedang Jahe Rp 6000"
print "5.Nasi Kuning Rp 7000 10.Es Kelapa Muda Rp 6000"
print
color 3
LOCATE 15, 5: PRINT GH$; " KODE "; GH$; " NAMA BARANG "; GH$; " JUMLAH "; GH$; " HARGA "; GH$; " JUMLAH HARGA "; GH$
LOCATE 15, 5: PRINT GH$; STRING$(6, GVA$); GH$; STRING$(18, GVA$); GH$; STRING$(10, GVA$); GH$; STRING$(13, GVA$); GH$; STRING$(14, GVA$); GH$
FOR BAR = 1 TO 10
LOCATE 15 + BAR, 5: PRINT GH$; STRING$(6, " "); GH$; STRING$(18, " "); GH$; STRING$(10, " "); GH$; STRING$(13, " "); GH$; STRING$(14, " "); GH$
NEXT BAR
LOCATE 16, 5: PRINT GH$; STRING$(50, GVA$); GH$; STRING$(14, GVA$); GH$
LOCATE 17, 5: PRINT GH$; STRING$(50, " "); GH$; STRING$(14, " "); GH$
LOCATE 18, 5: PRINT GH$; STRING$(50, GVA$); GH$; STRING$(14, GVA$); GH$
LOCATE 19, 5: PRINT GH$; STRING$(50, " "); GH$; STRING$(14, " "); GH$
LOCATE 20, 5: PRINT GH$; STRING$(50, GVA$); GH$; STRING$(14, GVA$); GH$
LOCATE 21, 5: PRINT GH$; STRING$(50, " "); GH$; STRING$(14, " "); GH$
LOCATE 22, 5: PRINT GH$; STRING$(50, GVB$); GH$; STRING$(14, GVB$); GH$
LOCATE 37, 3: PRINT GH$; " TOTAL BAYAR "
LOCATE 39, 3: PRINT GH$; " BAYAR "
LOCATE 41, 3: PRINT GH$; " KEMBALIAN "
color 3
locate 15,3:print "Kode"
locate 15,10:print "Nama"
locate 15,25:print "Harga Satuan"
locate 15,45:print "Jumlah"
locate 15,55:print "Harga Total"
uang = 0
x = 1
do
locate 17+x,5:input"",pilih
if pilih <0 or pilih>10 then
locate 17+x,5:print" "
locate 17+x,5:input"",pilih
end if
locate 17+x,10:print Namabarang$(pilih)
locate 17+x,25:print Harga(pilih)
locate 17+x,45 :input"",jumlah
total = harga(PILIH) * JUMLAH
locate 17+x,55 :print"",total
jumtotal = jumtotal + total
locate 37,50 :print"",jumtotal
x = x + 1
loop until pilih=0
locate 39,50 :input"",uang
kembalian = uang - jumtotal
while uang<jumtotal
locate 39,50 :print" "
locate 39,50 :input"",uang
wend
kembalian = uang - jumtotal
locate 41,50 :print"",kembalian
locate 43,50 :print "Terimakasih..."
berikut hasil outputnya:
disini saya ingin berbagi kodingan aplikasi warteg sederhana dengan menggunakan bahasa pemrograman QBasic. semoga bermanfaat :)
Keep Learn, Keep Coding.. ! :D
rem database
data "Nasi Uduk",7000
data "Nasi Rawon",6000
data "Pecel Lele",6000
data "Sate",15000
data "Nasi Kunning",7000
data "Es Teh",2000
data "Jus Jeruk",5000
data "Kopi",3000
data "Wedang Jahe",6000
data "Es Kelapa Muda",15000
rem variable
DIM namabarang$(20)
DIM harga(20)
rem baca database
for a=1 to 10
read namabarang$(a),harga(a)
next a
cls
x:
cls
color 3
print" Warteg Bengkel Perut "
color 4
print " Menu Kami"
color 7
print "Menu Makanan Harga Menu Minuman Harga "
color 4
print "1.Nasi Uduk Rp 7000 6.Es Teh Rp 2000"
print "2.Nasi Rawon Rp 6000 7.Jeruk Rp 5000"
print "3.Pecel Lele Rp 6000 8.Kopi Rp 3000"
print "4.Sate Rp 15000 9.Wedang Jahe Rp 6000"
print "5.Nasi Kuning Rp 7000 10.Es Kelapa Muda Rp 6000"
color 3
LOCATE 15, 5: PRINT GH$; " KODE "; GH$; " NAMA BARANG "; GH$; " JUMLAH "; GH$; " HARGA "; GH$; " JUMLAH HARGA "; GH$
LOCATE 15, 5: PRINT GH$; STRING$(6, GVA$); GH$; STRING$(18, GVA$); GH$; STRING$(10, GVA$); GH$; STRING$(13, GVA$); GH$; STRING$(14, GVA$); GH$
FOR BAR = 1 TO 10
LOCATE 15 + BAR, 5: PRINT GH$; STRING$(6, " "); GH$; STRING$(18, " "); GH$; STRING$(10, " "); GH$; STRING$(13, " "); GH$; STRING$(14, " "); GH$
NEXT BAR
LOCATE 16, 5: PRINT GH$; STRING$(50, GVA$); GH$; STRING$(14, GVA$); GH$
LOCATE 17, 5: PRINT GH$; STRING$(50, " "); GH$; STRING$(14, " "); GH$
LOCATE 18, 5: PRINT GH$; STRING$(50, GVA$); GH$; STRING$(14, GVA$); GH$
LOCATE 19, 5: PRINT GH$; STRING$(50, " "); GH$; STRING$(14, " "); GH$
LOCATE 20, 5: PRINT GH$; STRING$(50, GVA$); GH$; STRING$(14, GVA$); GH$
LOCATE 21, 5: PRINT GH$; STRING$(50, " "); GH$; STRING$(14, " "); GH$
LOCATE 22, 5: PRINT GH$; STRING$(50, GVB$); GH$; STRING$(14, GVB$); GH$
LOCATE 37, 3: PRINT GH$; " TOTAL BAYAR "
LOCATE 39, 3: PRINT GH$; " BAYAR "
LOCATE 41, 3: PRINT GH$; " KEMBALIAN "
color 3
locate 15,3:print "Kode"
locate 15,10:print "Nama"
locate 15,25:print "Harga Satuan"
locate 15,45:print "Jumlah"
locate 15,55:print "Harga Total"
uang = 0
x = 1
do
locate 17+x,5:input"",pilih
if pilih <0 or pilih>10 then
locate 17+x,5:print" "
locate 17+x,5:input"",pilih
end if
locate 17+x,10:print Namabarang$(pilih)
locate 17+x,25:print Harga(pilih)
locate 17+x,45 :input"",jumlah
total = harga(PILIH) * JUMLAH
locate 17+x,55 :print"",total
jumtotal = jumtotal + total
locate 37,50 :print"",jumtotal
x = x + 1
loop until pilih=0
locate 39,50 :input"",uang
kembalian = uang - jumtotal
while uang<jumtotal
locate 39,50 :print" "
locate 39,50 :input"",uang
wend
kembalian = uang - jumtotal
locate 41,50 :print"",kembalian
locate 43,50 :print "Terimakasih..."
berikut hasil outputnya:
Komentar
Posting Komentar