1.PENJULAN SEDERHANA
program penjualan;
uses wincrt;
var b :string ;
h,y,u,by,tb:real ;
lagi :char ;
begin
writeln('Toko "laris manis"');
Writeln('------------------');
tb:=0;
Lagi:='Y';
while lagi='Y' do
begin
write('barang:');readln(b);
write('Harga:');readln(h);
write('Unit:');readln(u);
by:=H*u;
writeln('Bayar:',by:0:0);
writeln('coba lagi(Y/T);');readln(Lagi);
writeln;
writeln;
tb:=tb+by;
end;
writeln('total bayar:',tb:0:0);
end.
2.PENJUALAN BARANG
program data_penjualan_barang;
uses wincrt;
const Nmaks=100;
type barang=record
kode:string[10];
nama:string[35];
banyak:integer;
harga:integer;
total:integer;
end;
type nilai=array[1..Nmaks] of barang;
var
M:nilai;
N:integer; {banyaknya barang}
i:integer; {indeks larik}
total:real;
begin
clrscr;
{inisialisasi larik}
for i:=1 to Nmaks do
begin
M[i].kode:=' ';
M[i].nama:=' ';
M[i].banyak:=0;
M[i].harga:=0;
M[i].total:=0;
end;
write('Banyaknya Barang : '); readln(N);
for i:=1 to N do
begin
writeln('Barang Ke-',i,' dari ',N);
write('Kode Barang : '); readln(M[i].kode);
write('Nama Barang : '); readln(M[i].nama);
write('Banyak Barang : '); readln(M[i].banyak);
write('Harga Satuan : '); readln(M[i].harga);
M[i].total:=M[i].harga*M[i].banyak;
total:=total+M[i].total;
writeln('total : ',M[i].total);
end;
{cetak isi larik}
clrscr;
writeln(' DATA PENJUALAN BARANG ');
writeln('==================================================================');
writeln('No | KodeBarang | NamaBarang | BanyakBarang | HargaSatuan | Total |');
writeln('==================================================================');
for i:=1 to N do
begin
writeln ( i,' ',M[i].kode,' ',M[i].nama,' ',M[i].banyak,' ',M[i].harga,' ',M[i].total);
end;
writeln('==================================================================');
writeln('Total Pembayaran: Rp',total:3:2);
readln;
end.
3.PENJUALAN TOKO BUKU
program penjulan;
uses wincrt;
var napem,nb:string[15] ;
hrg,jb,jh,disc,tot:real;
begin
clrscr;
writeln;
writeln('----------------------------------------');
writeln(' DATA PENJUALAN TOKO BUKU');
writeln('----------------------------------------');
writeln;
write('NAMA PEMBELI = '); readln(napem);
writeln;
write('BARANG YANG DI BELI = '); readln(nb);
writeln('.............................');
if nb='BUKU' then hrg:=12000 else
if nb='TAS' then hrg:=70000 else
if nb='SEPATU' then hrg:=50000 else
if nb='PENSIL' then hrg:=1000;
begin
end;
writeln;
write('HARGA =','Rp',hrg:6:0,'LUSIN');
writeln;
writeln;
write('JUMLAH BELI = '); readln(jb);
writeln;
jh:= hrg*jb;
write('JUMLAH HARGA =','Rp',jh:10:0);
writeln;
writeln('.............................');
writeln;
if jb > 3 then disc:=0.2*jh;
begin
end;
write('ANDA DAPAT DISKON=','Rp',disc:40:0);
writeln;
writeln('.............................');
writeln;
writeln;
write('Total Bayar =','Rp',hrg*jb-disc:10:0);
writeln;
writeln('----------------------------------------');writeln;
write('Terimakasih dan Tekan Enter');
readln;
end.
4.PROGRAM PENJUALAN
program k;
uses wincrt ;
var kd:char;
nama:string; jml,diskon,harga:real;
begin
write('kode:');readln(kd);
write('jumlah:');readln(jml);
if (kd='aa') then begin
writeln('nama :buku'); harga:=10000; diskon:=0; end else
if (kd='bb') then begin
writeln('nama :tas'); harga:=60000; diskon:=5; end else
if (kd='cc') then begin
writeln('nama :sepatu'); harga:=70000; diskon:=10; end;
writeln('harga:',harga:0:2); writeln('diskon:',diskon:0:2,'%');
end.
program penjualan;
uses wincrt;
var b :string ;
h,y,u,by,tb:real ;
lagi :char ;
begin
writeln('Toko "laris manis"');
Writeln('------------------');
tb:=0;
Lagi:='Y';
while lagi='Y' do
begin
write('barang:');readln(b);
write('Harga:');readln(h);
write('Unit:');readln(u);
by:=H*u;
writeln('Bayar:',by:0:0);
writeln('coba lagi(Y/T);');readln(Lagi);
writeln;
writeln;
tb:=tb+by;
end;
writeln('total bayar:',tb:0:0);
end.
2.PENJUALAN BARANG
program data_penjualan_barang;
uses wincrt;
const Nmaks=100;
type barang=record
kode:string[10];
nama:string[35];
banyak:integer;
harga:integer;
total:integer;
end;
type nilai=array[1..Nmaks] of barang;
var
M:nilai;
N:integer; {banyaknya barang}
i:integer; {indeks larik}
total:real;
begin
clrscr;
{inisialisasi larik}
for i:=1 to Nmaks do
begin
M[i].kode:=' ';
M[i].nama:=' ';
M[i].banyak:=0;
M[i].harga:=0;
M[i].total:=0;
end;
write('Banyaknya Barang : '); readln(N);
for i:=1 to N do
begin
writeln('Barang Ke-',i,' dari ',N);
write('Kode Barang : '); readln(M[i].kode);
write('Nama Barang : '); readln(M[i].nama);
write('Banyak Barang : '); readln(M[i].banyak);
write('Harga Satuan : '); readln(M[i].harga);
M[i].total:=M[i].harga*M[i].banyak;
total:=total+M[i].total;
writeln('total : ',M[i].total);
end;
{cetak isi larik}
clrscr;
writeln(' DATA PENJUALAN BARANG ');
writeln('==================================================================');
writeln('No | KodeBarang | NamaBarang | BanyakBarang | HargaSatuan | Total |');
writeln('==================================================================');
for i:=1 to N do
begin
writeln ( i,' ',M[i].kode,' ',M[i].nama,' ',M[i].banyak,' ',M[i].harga,' ',M[i].total);
end;
writeln('==================================================================');
writeln('Total Pembayaran: Rp',total:3:2);
readln;
end.
3.PENJUALAN TOKO BUKU
program penjulan;
uses wincrt;
var napem,nb:string[15] ;
hrg,jb,jh,disc,tot:real;
begin
clrscr;
writeln;
writeln('----------------------------------------');
writeln(' DATA PENJUALAN TOKO BUKU');
writeln('----------------------------------------');
writeln;
write('NAMA PEMBELI = '); readln(napem);
writeln;
write('BARANG YANG DI BELI = '); readln(nb);
writeln('.............................');
if nb='BUKU' then hrg:=12000 else
if nb='TAS' then hrg:=70000 else
if nb='SEPATU' then hrg:=50000 else
if nb='PENSIL' then hrg:=1000;
begin
end;
writeln;
write('HARGA =','Rp',hrg:6:0,'LUSIN');
writeln;
writeln;
write('JUMLAH BELI = '); readln(jb);
writeln;
jh:= hrg*jb;
write('JUMLAH HARGA =','Rp',jh:10:0);
writeln;
writeln('.............................');
writeln;
if jb > 3 then disc:=0.2*jh;
begin
end;
write('ANDA DAPAT DISKON=','Rp',disc:40:0);
writeln;
writeln('.............................');
writeln;
writeln;
write('Total Bayar =','Rp',hrg*jb-disc:10:0);
writeln;
writeln('----------------------------------------');writeln;
write('Terimakasih dan Tekan Enter');
readln;
end.
4.PROGRAM PENJUALAN
program k;
uses wincrt ;
var kd:char;
nama:string; jml,diskon,harga:real;
begin
write('kode:');readln(kd);
write('jumlah:');readln(jml);
if (kd='aa') then begin
writeln('nama :buku'); harga:=10000; diskon:=0; end else
if (kd='bb') then begin
writeln('nama :tas'); harga:=60000; diskon:=5; end else
if (kd='cc') then begin
writeln('nama :sepatu'); harga:=70000; diskon:=10; end;
writeln('harga:',harga:0:2); writeln('diskon:',diskon:0:2,'%');
end.
2 comments:
Masih eror kalo di jalankan
Masih eror kalo di jalankan
Post a Comment