Thursday, June 28, 2012

CONTOH PROGRAM MODULAR | TURBO PASCAL

Ini adalah Program Modular  yang mungkin bisa bermanfaat buat kalian semua yang membutuh kan...
semoga bermanfaat buat para pembaca... :)
TURBO PASCAL | PROGRAM MODULAR
 program modular;
uses wincrt;
const
ht36p66= 90000000;
ht30p66 = 100000000; {harga tipe(ht)}
ht36p72 = 110000000;
ht48p144 = 180000000;
perdp = 0.20;
perkdt = 0.10;
gapok = 1400000;
perfee =0.15; perpak = 0.05;
var
ht : longint;
dp,gatot,pjk,bikred,kdt,tokred,bucil,bonus: real;
n,laci,tipe : integer; {n adlh jumlah rumah yg terjual}

procedure cicilan_rumah;
begin
writeln (' kode tipe rumah ');
writeln (' 1. tipe 36/66 ');
writeln (' 2. tipe 32/66 ');
writeln (' 3. tipe 36/72 ');
writeln (' 4. tipe 48/144 ');
writeln ('====================================');
writeln ('------- rumah terjual ------ ');
writeln ('====================================');
write ('tipe rumah = ');readln (tipe);
write ('jumlah rumah = ');readln(n);
write ('lama cicilan = ');readln (laci);

if (tipe = 1) then
begin
writeln ('tipe rumah 30/66');
writeln ('harga rumah =Rp ',ht30p66);
ht:=n* ht30p66;
end;
if (tipe = 2) then
begin
writeln ('tipe rumah 36/66');
writeln ('harga rumah =Rp ',ht36p66);
ht:=n* ht36p66;
end;
if (tipe = 3) then
begin
writeln ('tipe rumah 36/72');
writeln ('harga rumah =Rp ',ht36p72);
ht:=n* ht36p72;
end;
if (tipe = 4) then
begin
writeln ('tipe rumah 48/144');
ht:=n* ht48p144;
end;
dp := ht*perdp;
bikred := (ht-dp)/laci;
bucil := bikred*perkdt;
tokred := bikred + bucil;
writeln ('jumlah harga jual =Rp ',ht);
writeln ('uang muka =Rp ',dp:0:2);
writeln ('biaya kredit per bulan =Rp ',bikred:0:2);
writeln ('bunga krdit 10% =Rp ',bucil:0:2);
writeln ('total kredit per bulan =Rp ',tokred:0:2);
end;
procedure gaji_marketing;
var
nama : string[20];
begin
writeln ('====================================');
writeln ('-----gaji dari penjualan rumah------');
writeln ('====================================');
bonus := dp * perfee;
pjk := gapok * perpak;
gatot :=gapok-pjk+bonus;
write('nama = ');readln(nama);
writeln('gaji pokok =Rp ',gapok);
writeln('bonus penjualan =Rp ',bonus:0:2);
writeln('pajak =Rp ',pjk:0:2);
writeln('total gaji =RP ',gatot:0:2);
end;

begin
cicilan_rumah;
gaji_marketing;
readln;
donewincrt;
end.

No comments:

Post a Comment