0% found this document useful (0 votes)
35 views8 pages

Tugas Akhir: Praktikum Algoritma Dan Pemrograman

The document is a Pascal program for a cashier system at a store. It includes: 1) A menu with options for product list, transactions, sales report, and exit. 2) Arrays defined to store product names, prices, quantities, and transaction details. 3) Code for each menu option, including input/output and calculations. 4) Validation to check for valid product selection and complete transactions. 5) A report generated with transaction details and total sales.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views8 pages

Tugas Akhir: Praktikum Algoritma Dan Pemrograman

The document is a Pascal program for a cashier system at a store. It includes: 1) A menu with options for product list, transactions, sales report, and exit. 2) Arrays defined to store product names, prices, quantities, and transaction details. 3) Code for each menu option, including input/output and calculations. 4) Validation to check for valid product selection and complete transactions. 5) A report generated with transaction details and total sales.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Tugas Akhir

PRAKTIKUM
ALGORITMA DAN PEMROGRAMAN

OLEH :

NAMA : MIFTAH UDIN


NIM : F1A218021
KELOMPOK : I (SATU)

PROGRAM STUDI S1 STATISTIKA


FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
UNIVERSITAS HALU OLEO
KENDARI
2019
Soal :
Buat program kasir di pascal dengan program berikut: minimal penginputan
sebanyak 10 transaksi dan datanya tidak boleh ada yang sama masing-
masing orang.
Sistem Informasi Mahasiswa
Program Studi S1 Statistika
1. Daftar Barang dan Harga
Daftar Barang dan Harga Toko xxxxx…
…Barang...........Harga
1.Pensil Rp.1.000
2.Buku Rp.2.000
3. …… Rp. ……

2. Transaksi
Masukkan Nama Barang :...................
Masukkan Harga Barang :...................
Masukkan Jumlah Barang :..................
Pembayaran :...................
Kembalian :......................

3. Laporan Hasil Penjualan


Sistem Informasi Mahasiswa
Program Studi S1 Statistika
NamaBrg Jmlh Harga pembayaran Kembalian

Total pemasukan hari ini adalah : Rp........


Alhamdulillah
4. Keluar
Halo Nama Saya...............
Pilih Menu (1/2/3/4):…....

Jawab :

Program :
uses crt;
label

top,bot,mid;

var
B : array [1..50] of string;
H : array [1..50] of longint;
harga : array [1..50] of longint;
i,pilih,byk,a : integer;
jml, semua : longint;
ulang : string;
tekan : char;
banyak : array [1..50] of integer;
barang : array [1..50] of string;
total : array [1..50] of longint;
bayar : array [1..50] of longint;
kembalian : array [1..50] of longint;

begin
top :
clrscr;
writeln ('==========BUTIK AKHWAT===========');
writeln ('Jl.MT.HARYONO, Telp.082108085959');
writeln ('1. Daftar Barang dan Harga') ;
writeln ('2. Transaksi') ;
writeln ('3. Laporan Hasil Penjualan') ;
writeln ('4. Keluar') ;
writeln ('Halo Nama Saya Miftah Udin');
write ('Silahkan Pilih Menu(1/2/3/4) = ') ; readln
(pilih);
B[1] := 'Jilbab' ; H[1] := 50000;
B[2] := 'Gamis' ; H[2] := 200000;
B[3] := 'Rok' ; H[3] := 100000;
B[4] := 'Mukenah' ; H[4] := 300000;
B[5] := 'Celana Kulot' ; H[5] := 100000;
B[6] := 'Sejadah' ; H[6] := 150000;
B[7] := 'Baju Kokoh' ; H[7] := 100000;
B[8] := 'Sarung' ; H[8] := 130000;
B[9] := 'Kopiah' ; H[9] := 45000 ;

if pilih = 1 then
begin
clrscr;
writeln ('Daftar Barang dan Harga Butik Akhwat');
writeln ('=====================================');
writeln ('| Nama Barang | Harga |');
writeln ('=====================================');
gotoxy (1,14);
writeln ('=====================================');
for i := 1 to 9 do
begin
gotoxy (1,4+i) ; writeln ('|');
gotoxy (3,4+i) ; writeln (B[i]);
gotoxy (25,4+i) ; writeln ('Rp. ',H[i]);
gotoxy (21,4+i) ; writeln ('|');
gotoxy (37,4+i) ; writeln ('|');
end;
writeln;
write ('Tekan Mana Saja Untuk Kembali');
tekan := Readkey;
goto top;
end
else if pilih =2 then
begin
a := 1;
REPEAT
clrscr;
writeln ('==============TRANSAKSI==============');
writeln ('Daftar Nama Barang Yang tersedia = ');
for i := 1 to 5 do
begin
gotoxy(2,2+i) ; write(i,'. ',B[i],' ');
writeln;
end;
for i := 6 to 9 do
begin
gotoxy(20,i-3) ; write(i,'. ',B[i],' ');
writeln;
end;
writeln;
write ('Nama Barang = ');
readln(barang[a]);
case barang[a] of
'Jilbab' : harga[a] := H[1];
'Gamis' : harga[a] := H[2];
'Rok' : harga[a] := H[3];
'Mukenah' : harga[a] := H[4];
'Celana Kulot': harga[a] := H[5];
'Sejadah' : harga[a] := H[6];
'Baju Kokoh' : harga[a] := H[7];
'Sarung' : harga[a] := H[8];
'Kopiah' : harga[a] := H[9];
else
begin
writeln ('Daftar barang tidak tersedia');
barang[a] := 'Format Error';
harga[a] := 000;
end;
end;
writeln ('Harga Barang = Rp.',harga[a]);
write ('Jumlah Barang = ');
readln(banyak[a]);
write ('Pembayaran = Rp.');
readln(bayar[a]);
total[a] := banyak[a]*harga[a];
kembalian[a] := bayar[a]-total[a] ;
writeln ('Kembalian = Rp.',kembalian[a]);
jml := jml + total[a];
a := a + 1;
semua := semua + total[a];
write ('Lakukan Transaksi Lainnya (Ya/Tidak) = ');
readln(ulang);
UNTIL ulang = 'Tidak';

writeln ('Anda Membeli Barang Sebanyak = ',a-1,'


Jenis');
write ('Tekan Mana Saja Untuk Kembali'); tekan :=
Readkey;
goto top;
end
else if pilih = 3 then
begin
clrscr;
writeln ('======== BUTIK AKHWAT===========');
writeln ('Jl.MT.HARYONO, Telp.082108085959');
write ('Banyak Barang Yang Anda Beli = ');
readln(byk);
gotoxy (3,5) ; write ('Nama Barang');
gotoxy (18,5) ; write ('Jumlah');
gotoxy (27,5) ; write ('Harga');
gotoxy (40,5) ; write ('Pembayaran');
gotoxy (55,5) ; write ('Kembalian');
gotoxy (2,5); write('|');
gotoxy (17,5); write('|');
gotoxy (26,5); write('|');
gotoxy (39,5); write('|');
gotoxy (54,5); write('|');
gotoxy (64,5); write('|');
for i := 1 to byk do
begin
gotoxy (3,6+i); write(barang[i]);
gotoxy (18,6+i); write(banyak[i]:4);
gotoxy (27,6+i); write('Rp.',harga[i]);
gotoxy (40,6+i); write('Rp.',bayar[i]);
gotoxy (55,6+i); write('Rp.',kembalian[i]);
gotoxy (2,6+i); write('|');
gotoxy (17,6+i); write('|');
gotoxy (26,6+i); write('|');
gotoxy (39,6+i); write('|');
gotoxy (54,6+i); write('|');
gotoxy (64,6+i); write('|');
end;
for a := 0 to 62 do
begin
gotoxy (2+a,4) ; write('=');
gotoxy (2+a,6) ; write('=');
gotoxy (2+a,7+byk); write('=');
end;
writeln;
writeln(' Jumlah Pemasukkan Hari ini = Rp.',jml);
write (' Alhamdulillah ');
end
else if pilih = 4 then goto bot
else writeln ('Anda Salah Memasukkan Input');

bot :
readln;
end.
HASIL RUN :

1.Daftar harga

2.Transaksi
3.Laporan hasil penjualan

You might also like