Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail

Rabu, 24 April 2013

Program Pascal Menghitung Biaya Rumah Sakit

Program ini dibuat sebagai tugas quiz pada Mata Kuliah Pemrograman terstruktur pertemuan ke 7 (22 April 2013).

berikut script codenya:
 
Program Biaya_Rumah_Sakit;
uses wincrt;
var
al,nm,pj,kel,ask:string;
b,hrg,pot,tob:real;
bk,bo,um,li:integer;

begin
writeln('********************************');
writeln('    RUMAH SAKIT BATAM SEHAT     ');
writeln('================================');
write('Nama               = ');readln(nm);
write('Alamat             = ');readln(al);
write('Umur               = ');readln(um);
write('Penanggung jawab   = ');readln(pj);
writeln('biaya konsultasi = Rp.10000');
write('biaya obat         = ');Readln(bo);
write('Lama inap          = ');readln(li);
write('Kelas (1/2/3/4)    = ');readln(kel);
if(kel='1')then
  hrg:=li*700000 else
    if(kel='2')then
      hrg:=li*600000 else
        if(kel='3')then
          hrg:=li*500000 else
            if(kel='4')then
              hrg:=li*400000;
b:=hrg+bo+10000;
writeln;
writeln('Biaya           = Rp.',b:4:2);
write('Kartu askes (y/n) = ');readln(ask);
clrscr;
writeln('********************************');
writeln('    RUMAH SAKIT BATAM SEHAT     ');
writeln('================================');
  if ask='y' then
    pot:=b*45/100;
      tob:=(b-pot);
writeln;
writeln('Nama            = ',nm);
writeln('Umur            = ',um);
writeln('Alamat          = ',al);
writeln('Biaya Konsultasi= Rp.10000');
writeln('Biaya Obat      = Rp.',bo);
writeln('Biaya Inap      = Rp.',hrg:3:2);
writeln('Askes           = ',ask);
writeln;
writeln('TOTAL BIAYA     = Rp.',tob:3:2);
writeln('------------');
writeln;
writeln('********************************');
end.

Tidak ada komentar: