Kamis, 05 Januari 2012

MENGHITUNG BONUS BELANJA

program Bonus;
uses wincrt;
var n,b,t:longint;I:integer;
begin
clrscr;
for I:= 1 to 29 do
begin write('==');
end;
writeln;
gotoxy(1,2);writeln('NO');
gotoxy(1,3);for I:= 1 to 29 do
begin write('==');
end;
writeln;
for I:= 1 to 4 do
begin
writeln(I);
end;
gotoxy(11,2);writeLN('KONDISI');
gotoxy(9,4);writeln('BELANJA > 100 RB');
gotoxy(6,5);writeln('100 RB <= BELANJA < 50 RB');
gotoxy(7,6);writeln('50 RB <= BELANJA < 10 RB');
gotoxy(9,7);writeln('BELANJA< 10 RB');
gotoxy(39,2);write('BONUS');
gotoxy(33,4);write('DISKON 10% TOTAL BELANJA');
gotoxy(38,5);write('PIRING');
gotoxy(38,6);write('GELAS');
gotoxy(41,7);writeln('-');
for I:= 1 to 29 do
begin write('==');
end;
writeln;
gotoxy(5,9);write ('Berapa jumlah belanja Anda ? ');
read(b);
if (b > 100000) then
begin
gotoxy(5,10);writeln('Anda mendapat bonus 10%');
gotoxy(5,11);writeln('Potongan yang didapat sebesar ',b*10 div 100);
t:=b-(b*10 div 100);
gotoxy(5,12);writeln('Total Bayar = ',t);
end
else if (b <= 100000) and (b > 50000) then
begin
gotoxy(5,10);writeln('Anda mendapat bonus Piring');
gotoxy(5,11);writeln('Total Bayar = ',b);
end
else if (b<=50000) and (b>10000) then
begin
gotoxy(5,10);writeln('Anda mendapat bonus Gelas');
gotoxy(5,11);writeln('Total Bayar = ',b);
end
else
begin
gotoxy(5,10);writeln('Tidak mendapat bonus');
gotoxy(5,11);writeln('Total Bayar = ',b);
end;
readln;
readln;
end.

0 komentar:

Posting Komentar