program pascal perhitungan waktu warnet
program
konversi_waktu_bayar;
uses crt;
var
jam_awal, jam_akhir,
menit_awal, menit_akhir, jml_waktu: integer;
awal, akhir,
jam, menit, sisa, jml, bayar: integer;
begin
clrscr;
writeln;
writeln('-------------------------------');
write(' Waktu Masuk (xx:xx)
:');
gotoxy(26,3); readln(jam_awal);
gotoxy(28,3); write(':');
gotoxy(29,3); readln(menit_awal);
write(' Waktu Keluar (xx:xx) :');
gotoxy(26,4); readln(jam_akhir);
gotoxy(28,4); write(':');
gotoxy(29,4); readln(menit_akhir);
awal:=(jam_awal*60)+menit_awal;
akhir:=(jam_akhir*60)+menit_akhir;
jml_waktu:=akhir-awal;
writeln('-------------------------------');
jam:=jml_waktu div 60;
menit:=jml_waktu mod 60;
write('Total waktu : ');
if jam>0 then write(jam,' jam ');
if menit>0 then write(menit,'
menit');
writeln;
writeln('Keterangan : Rp.500 / 10 menit');
jml:=jml_waktu div 10;
sisa:=jml_waktu mod 10;
if sisa>=5 then
bayar:=(jml*500)+500;
if sisa<5 span="" style="mso-spacerun: yes;"> 5>then bayar:=jml*500;
writeln('Total Bayar : ',bayar);
readkey;
end.
Tidak ada komentar:
Posting Komentar