Tuesday, May 3, 2011

Program UTS soal nomer 4 Pemrograman Terstruktur

program xxx;
uses crt;
var a,b,c : real;
z : char;
begin
clrscr;
z := 'Y';
repeat
z := 'Y';
write('Masukan Jumlah Bayar :');
readln(a);
if a <= 200000 then
begin
b:= a * 0.04;
end
else
begin
if a <= 100001 then
b := a * 0.02;
end;
c := a-b;
writeln('Jumlah bayar :',a :8:2);
writeln('Potongan     :',b :8:2);
writeln('Total bayar  :',c :8:2);
write('Mau Hitung Lagi [Y/T] ?');
readln(z);
until z <> 'Y';
readln;
end.

0 komentar:

Post a Comment

Tinggalkan Komentar Disini