Program Biaya Telepon dalam PASCAL

program biaya_telfon;

uses wincrt;

var

dtk1,dtk2,dtk,mnt1,mnt2,mnt,jam1,jam2,jam,lama:longint;

biaya:real;

begin

write(‘jam mulai telp : ‘);read(jam1);

write(‘menit mulai telp: ‘);read(mnt1);

write(‘detik mulai telp: ‘);read(dtk1);

write(‘jam selesai telp : ‘);readln(jam2);

write(‘menit selesai telp: ‘);read(mnt2);

write(‘detik selesai telp: ‘);read(dtk2);

jam:=jam2-jam1;

mnt:=mnt2-mnt1;

dtk:=dtk2-dtk1;

lama:=(jam*3600)+(mnt*60)+dtk;

biaya:=(lama div 5)*200;

clrscr;

writeln(‘mulai telefon pukul : ‘,jam1,’:’,mnt1,’:’,dtk1);

writeln(‘selesai telefon pukul : ‘,jam2,’:’,mnt2,’:’,dtk2);

writeln(‘lama telepon :’,lama,’ detik ‘);

write(‘biaya telepon : Rp.’,biaya:10:2);

end.

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

%d blogger menyukai ini: