Konversi Jarak
uses
wincrt;
var
jarak,km,m,cm,sisa : longint;
yt : char;
begin
yt :='Y';
repeat
clrscr;
write('Semut telah berjalan sepanjang = '); readln(jarak);
km :=jarak div 100000;
sisa :=jarak mod 100000;
m :=sisa div 100;
cm := sisa mod 100;uses
wincrt;
var
suhu1,suhu2,suhu3 : integer;
faren1,faren2,faren3 : real;
ream1,ream2,ream3 : real;
begin
write('Masukkan SUHU-1 : '); readln(suhu1);
write('Masukkan SUHU-2 : '); readln(suhu2);
write('Masukkan SUHU-3 : '); readln(suhu3);
writeln;
writeln;
ream1 :=( 4/5 )* suhu1;
ream2 :=( 4/5 )* suhu2;
ream3 :=( 4/5 )* suhu3;
faren1 := 9/5 * suhu1 + 32;
faren2 := 9/5 * suhu2 + 32;
faren3 := 9/5 * suhu3 + 32;
writeln('---------------------------------------------------------');
writeln('! SUHU ! FAHRENHEIT ! REAMUR !');
writeln('---------------------------------------------------------');
writeln('! ',suhu1,' ! ',faren1:2:2,' ! ',ream1:2:2,' !');
writeln('! ',suhu2,' ! ',faren2:2:2,' ! ',ream2:2:2,' !');
writeln('! ',suhu3,' ! ',faren3:2:2,' ! ',ream3:2:2,' !');
end.
writeln;
write('Maka semut tersebut menempuh jarak sejauh : '); writeln(km,' km + ',m,' m + ',cm,' cm');
writeln;
write('Ingin mengulang :');readln(yt);
until upcase (yt) = 'T';
end.
Jumat, 30 Maret 2012
contoh source kode pascal 2
Konversi Suhu
0 komentar:
Posting Komentar