Program case_of_lanjut;
uses wincrt;
var pilih,jml,diskon : integer;
nmbrng :
string;
ulang
:boolean;
lagi :
char;
harsat,hrgbrg,hrgpajak,tothrg : real;
begin
clrscr;
ulang:=true;
while ulang do
begin
clrscr;
writeln('**************Menu
Utama**************');
writeln('======================================');
writeln('1. Hitung HArga Barang ');
writeln('2. Hitung Diskon Barang ');
writeln('3. Hitung Pajak Barang ');
writeln('4. Selesai ');
writeln('======================================');
write('pilih (1-4) : ');readln(pilih);
writeln('=======================================');
case pilih of
1: begin
clrscr;
lagi:='Y';
while upcase(lagi)='Y' do
begin
write('Nama Barang : ');
readln(nmbrng);
write('Jumlah Barang : ');
readln(jml);
write('Harga Satuan : ');
readln(harsat);
tothrg:=jml*harsat;
writeln('Total Harga : ',tothrg:12:2);
writeln;
write('Mau isi lagi (Y/T)?: ');
readln(lagi);
end;
end;
2: Begin
clrscr;
lagi:='Y';
while upcase(lagi)='Y'do
begin
write('Nama Barang : ');
readln(nmbrng);
write('Harga Satuan : ');
readln(harsat);
write('Diskon (%) : ');
readln(diskon);
hrgbrg:=harsat-(harsat*(diskon/100));
writeln('Harga Barang : ',hrgbrg:12:2);
writeln;
write('Mau isi lagi(Y/T)?: ');
readln(lagi);
end;
end;
3: Begin
clrscr;
lagi:='Y';
while upcase(lagi)='Y' do
begin
write('nama Barang : ');
readln(nmbrng);
write('harga barang : ');
readln(hrgbrg);
write('Kena pajak 10% ');
hrgpajak:=10/100*hrgbrg;
writeln('Harga Barang Setelah Pajak : ',hrgpajak:12:2);
writeln;
write('Mau isi Lagi(Y/T)? : ');
readln(lagi);
end;
end;
4: exit;
end;
end;
end.
Tidak ada komentar:
Posting Komentar
Semoga Bermanfaat