Sintak Program :
Program kasir_Array;
Uses Wincrt;
Type Kasir = record
no_trans, tgl, nama, nm_brg : String[10];
kd_brg, jml : byte;
hrg, tot : real;
End;
Var
Data : Array [1..100] of Kasir;
Ul : Char;
i,n, x : Integer;
jml_penjualan : real;
Begin
Repeat
Clrscr;
i:=i+1;
Writeln(' MUSLIHUDIN TECHNOLOGY ');
Writeln(' Jl.RE Martadinata no.202 Tasikmalaya ');
Writeln('========================================');
Writeln;
writeln(' Form Transaksi ');
writeln;
Writeln('Data Ke-',i);
Writeln;
Write('No Transaksi : ');Readln(Data[i].no_trans);
Write('Tanggal : ');Readln(Data[i].tgl);
Write('Nama Pembeli : ');Readln(Data[i].nama);
Write('Kode Barang : ');Readln(Data[i].kd_brg);
if Data[i].kd_brg = 1 then
begin
Data[i].nm_brg :='Processor Core i3';
Data[i].hrg :=1131000;
end
else if Data[i].kd_brg = 2 then
begin
Data[i].nm_brg :='Printer';
Data[i].hrg :=500000;
end
else if Data[i].kd_brg = 3 then
begin
Data[i].nm_brg :='Harddisk';
Data[i].hrg :=700000;
end
else if Data[i].kd_brg = 4 then
begin
Data[i].nm_brg :='Flash Disk';
Data[i].hrg :=100000;
end
else if Data[i].kd_brg = 5 then
begin
Data[i].nm_brg :='Mouse';
Data[i].hrg :=125000;
end
else if Data[i].kd_brg = 6 then
begin
Data[i].nm_brg :='VGA Nvidia';
Data[i].hrg :=400000;
end
else if Data[i].kd_brg = 7 then
begin
Data[i].nm_brg := 'Memory DDR3';
Data[i].hrg := 235000;
end
else if data[i].kd_brg = 8 then
begin
data[i].nm_brg := 'Monitor';
data[i].hrg := 750000;
end;
Writeln('Nama Barang : ',Data[i].nm_brg);
Writeln('Harga : ',Data[i].hrg:0:0);
Write ('Jumlah Beli : ');Readln(Data[i].jml);
Data[i].tot:=Data[i].jml*Data[i].hrg;
writeln('Total Bayar : ',Data[i].tot:0:0);
Writeln;
write('Tambah Data (Y/T) : ');readln(Ul);
until upcase (Ul) <> 'Y';
n:=i;
Clrscr;
gotoxy(1,1);Write('============================ MUSLIHUDIN TECHNOLOGY =============================');
gotoxy(1,2);Write('=========================================================================');
gotoxy(1,3);write('|No.Tran |Tanggal |Nama Pembeli |Nama Barang |Harga |Jumlah |Total |');
gotoxy(1,4);Write('=========================================================================');
For x := 1 to n do
begin
gotoxy(1,x+4);write('|');
gotoxy(2,x+4);write(x);
gotoxy(10,x+4);write('|');
gotoxy(11,x+4);write(data[x].tgl);
gotoxy(19,x+4);write('|');
gotoxy(20,x+4);write(data[x].nama);
gotoxy(33,x+4);write('|');
gotoxy(34,x+4);write(data[x].nm_brg);
gotoxy(47,x+4);write('|');
gotoxy(48,x+4);write(data[x].hrg:0:0);
gotoxy(59,x+4);write('|');
gotoxy(60,x+4);write(data[x].jml);
gotoxy(67,x+4);write('|');
gotoxy(68,x+4);write(data[x].tot:0:0);
gotoxy(80,x+4);write('|');
jml_penjualan:=jml_penjualan+Data[x].tot;
end;
Write('================================================================================');
Writeln('Jumlah Transaksi : ', i);
Writeln('Jumlah Penjualan : Rp.',jml_penjualan:0:0);
End.
Gambar Program :
Semoga Bermanfaat
0 comments:
Post a Comment