Jumat, 09 Januari 2015

LATIHAN E NO 5

uses wincrt;
var
 volume,gol1,gol2,gol3,gol4,total:longint;
begin
write('Masukkan pemakaian (m3) = ');readln(volume);
if volume<=50 then
 begin
 gol1:=volume*1500;
 end
else if volume<=75 then
 begin
 gol1:=50*1500;
 gol2:=(volume-50)*1750;
 end
else if volume<=100 then
 begin
 gol1:=50*1500;
 gol2:=25*1750;
 gol3:=2000*(volume-75);
 end
else
 begin
 gol1:=50*1500;
 gol2:=25*1750;
 gol3:=25*200;
 gol4:=2250*(volume-100);
 end;
total:=gol1+gol2+gol3+gol4;
writeln('---------------------------------------------------------');
writeln('harga golongan 1 = Rp.',gol1:8);
writeln('harga golongan 2 = Rp.',gol2:8);
writeln('harga golongan 3 = Rp.',gol3:8);
writeln('harga golongan 4 = Rp.',gol4:8);
writeln('---------------------------------------------------------');
writeln('total bayar = Rp. ',total:8);
readln;
end.


Hasilnya

Tidak ada komentar:

Posting Komentar