Jurnal TI - Kasir

software Kasir kelompok 33 dibuat untuk menampilkan total harga barang keseluruhan serta menghitung jumlah kembalian dari sejumlah uang yang di input serta mencetak struk.

Flowchart Software Kasir


 Pseudocode Software Kasir


Algoritma SoftwareKasir
{membuat suatu software untuk kasir, dimana petugas kasir menginput kode kasir untuk menampilkan nama dan harga barang kemudian menghitung total harga beserta kembalian}

Deklarasi
kode_brg1 = string      kode_brg2 = string
kode_brg3 = string      kode_brg4 = string
kode_brg5 = string      nama_brg1 = string
nama_brg2 = string     nama_brg3 = string
nama_brg4 = string     nama_brg5 = string
hrg1 = integer              hrg2 = integer
hrg3 = integer              hrg4 = integer
hrg5 = integer              jml1 = integer
jml2 = integer              jml3 = integer
jml4 = integer              jml5 = integer
totalbayar = integer     kembalian = integer
uang = integer

Deskripsi
START
write("Masukkan 5 DIGIT kode barang :")
write("Contoh : Susu coklat = 33001")
write("Kode barang 1 :")
read kode_brg1
write("Jumlah :")
read jml1
                        if(kode_brg1 = ("33001"))then
                        nama_brg1 = "Susu Coklat",hrg1 = 8000
                       
                        elseif(kode_brg1 = ("33002"))then
                        nama_brg1 = "Susu Vanilla", hrg1 = 5000

                        elseif(kode_brg1 = ("33003"))then
                        nama_brg1 = "Susu Strawberry", hrg1 = 6000
                       
                        elseif(kode_brg1 = ("33004"))then
                        nama_brg1 = "Susu Sapi Murni", hrg1 = 12000
                       
                        elseif(kode_brg1 = ("33005"))then
                        nama_brg1 = "Susu Kambing Murni”, hrg1 = 9000
                       
                        else
                        write("Kode barang salah!:")
                        endif
            write("Kode barang 2 :")
            read kode_brg2
            write("Jumlah :")
            read jml2
                        if(kode_brg2 = ("33001"))then
                        nama_brg2 = "Susu Coklat", hrg2 = 8000
                       
                        elseif(kode_brg2 = ("33002"))then
                        nama_brg2 = "Susu Vanilla", hrg2 = 5000
                       
                        elseif(kode_brg2 = ("33003"))then
                        nama_brg2 = "Susu Strawberry", hrg2 = 6000
                       
                        elseif(kode_brg2 = ("33004"))then
                        nama_brg2 = "Susu Sapi Murni", hrg2 = 12000
                       
                        elseif(kode_brg2 = ("33005"))then
                        nama_brg2 = "Susu Kambing Murni", hrg2 = 9000
                       
                        else then
                        write("Kode barang salah!:")
                        endif
write("Kode barang 3 :")
read kode_brg3
write("Jumlah :")
read jml3
                        if(kode_brg3 = ("33001"))then
                        nama_brg3 = "Susu Coklat", hrg3 = 8000
                       
                        elseif(kode_brg3 = ("33002"))then
                        nama_brg3 = "Susu Vanilla", hrg3 = 5000
                       
                        elseif(kode_brg3 = ("33003"))then
                        nama_brg3 = "Susu Strawberry", hrg3 = 6000
                       
                        elseif(kode_brg3 = ("33004"))then
                        nama_brg3 = "Susu Sapi Murni", hrg3 = 12000
                       
                        elseif(kode_brg3 = ("33005"))then
                        nama_brg3 = "Susu Kambing Murni", hrg3 = 9000

                        else
                        write("Kode barang salah!:")
                        endif

write("Kode barang 4 :")
read kode_brg4
write("Jumlah :")
read jml4       
                        if(kode_brg4 = ("33001"))then
                        nama_brg4 = "Susu Coklat", hrg4 = 8000
                       
                        elseif(kode_brg1 = ("33002"))then
                        nama_brg4 = "Susu Vanilla", hrg4 = 5000
                       
                        elseif(kode_brg4 = ("33003"))then
                        nama_brg4 = "Susu Strawberry", hrg4 = 6000
                       
                        elseif(kode_brg4 = ("33004"))then
                        nama_brg4 = "Susu Sapi Murni", hrg4= 12000
                       
                        elseif(kode_brg4 = ("33005"))then
                        nama_brg4 = "Susu Kambing Murni", hrg4 = 9000
                       
                        else
                        write("Kode barang salah!:")
                        endif
write("Kode barang 5 :")
read kode_brg5          
write("Jumlah :")
read jml5                    
                        if(kode_brg5 = ("33001"))then
                        nama_brg5 = "Susu Coklat", hrg5 = 8000
                       
                        elseif(kode_brg5 = ("33002"))then
                        nama_brg5 = "Susu Vanilla", hrg5 = 5000
                       
                        elseif(kode_brg5 = ("33003"))then
                        nama_brg5 = "Susu Strawberry", hrg5 = 6000
                       
                        elseif(kode_brg5 = ("33004"))then
                        nama_brg5 = "Susu Sapi Murni", hrg5 = 12000
                       
                        elseif(kode_brg5 = ("33005"))then
                        nama_brg5 = "Susu Kambing Murni", hrg5 = 9000

                        else
                        write("Kode barang salah!:")
endif                           
write("Terima kasih!")
totalbayar = ((jml1*hrg1)+(jml2*hrg2)+(jml3*hrg3)+(jml4*hrg4)+(jml5*hrg5))
write("Jadi, total harganya adalah : " + totalbayar)
write("Sekarang, masukkan jumlah uang yang dibayarkan :")
kembalian = (uang - totalbayar)
write("Uang anda adalah : " + uang)
write("Jadi, kembalian anda adalah " + totalbayar + " rupiah")
write("Nama Barang         Jumlah        Total")
write(nama_brg1+jml1+(jml1*hrg1))
write(nama_brg2+jml2+(jml2*hrg2))
write(nama_brg3+jml3+(jml3*hrg3))
write(nama_brg4+jml4+ (jml4*hrg4))
write(nama_brg5+jml5+(jml5*hrg5))
write("Total Harga : " + totalbayar)
write("Uang : " +uang)
write("Kembalian   : " +kembalian)
STOP

0 komentar: