โปรแกรม แปลงหน่อย องศา ครับ
program thermometer;
var degree,i:integer;
var ans:char;
begin
repeat
writeln('Welcome To Program Calculator');
writeln('-----------------------------');
writeln('1.Fahrenheit To Celsius');
writeln('2.Celsius To Fahrenheit');
writeln('3.kelvin To Celsius');
writeln('4.Reaumur To Celsius');
writeln('5.Celsius To Reaumur');
writeln('6.Celsius To kelvin');
writeln('7.kelvin To Fahrenheit');
writeln('8.Fahrenheit To kelvin');
writeln;
write('Please Select Choice : ');
readln(i);
case i of
1 : begin
writeln('Fahrenheit To Celsius');
writeln('---------------------');
writeln;
write('Input Your Fahrenheit = ');readln(degree);
writeln('Celsius is = ',(5/9)*(degree-32));
end;
2 : begin
writeln('Celsius To Fahrenheit');
writeln('---------------------');
writeln;
write('Input Your Celsius = ');readln(degree);
writeln('Fahrenheit is = ',((9/5)*degree)+32);
end;
3 : begin
writeln('kelvin To Celsius');
writeln('---------------------');
writeln;
write('Input Your kelvin = ');readln(degree);
writeln('Celsius is = ',degree-273.15);
end;
4 : begin
writeln('Reaumur To Celsius');
writeln('---------------------');
writeln;
write('Input Your Reaumur = ');readln(degree);
writeln('Celsius is = ',degree*1.25);
end;
5 : begin
writeln('Celsius To Reaumur');
writeln('---------------------');
writeln;
write('Input Your Celsius = ');readln(degree);
writeln('Reaumur is = ',degree*0.
;
end;
6 : begin
writeln('Celsius To kelvin');
writeln('---------------------');
writeln;
write('Input Your Celsius = ');readln(degree);
writeln('kelvin is = ',degree+273.15);
end;
7 : begin
writeln('kelvin To Fahrenheit');
writeln('---------------------');
writeln;
write('Input Your kelvin = ');readln(degree);
writeln('Fahrenheitr is = ',(degree*1.
-459.67);
end;
8 : begin
writeln('Fahrenheit To kelvin');
writeln('---------------------');
writeln;
write('Input Your Fahrenheit = ');readln(degree);
writeln('kelvin is = ',(degree+459.67)/1.
;
end;
else
begin
writeln('Your Unkwon Choice!!')
end;
end;
writeln;
write('Press Any Key To Exit');
readln;
Write('Do you want to Exit (Y/N) = '); readln(ans);
ans:=upcase(ans);
until ans ='Y';
end.
น้องใหม่ ครับ รันผ่านแล้ว แต่ว่าเครื่องผมใช้คำสั่ง เคลียร์ หน้าจอไม่ได้ ก็เลยตัดออก
ติชมได้ครับ
program thermometer;
var degree,i:integer;
var ans:char;
begin
repeat
writeln('Welcome To Program Calculator');
writeln('-----------------------------');
writeln('1.Fahrenheit To Celsius');
writeln('2.Celsius To Fahrenheit');
writeln('3.kelvin To Celsius');
writeln('4.Reaumur To Celsius');
writeln('5.Celsius To Reaumur');
writeln('6.Celsius To kelvin');
writeln('7.kelvin To Fahrenheit');
writeln('8.Fahrenheit To kelvin');
writeln;
write('Please Select Choice : ');
readln(i);
case i of
1 : begin
writeln('Fahrenheit To Celsius');
writeln('---------------------');
writeln;
write('Input Your Fahrenheit = ');readln(degree);
writeln('Celsius is = ',(5/9)*(degree-32));
end;
2 : begin
writeln('Celsius To Fahrenheit');
writeln('---------------------');
writeln;
write('Input Your Celsius = ');readln(degree);
writeln('Fahrenheit is = ',((9/5)*degree)+32);
end;
3 : begin
writeln('kelvin To Celsius');
writeln('---------------------');
writeln;
write('Input Your kelvin = ');readln(degree);
writeln('Celsius is = ',degree-273.15);
end;
4 : begin
writeln('Reaumur To Celsius');
writeln('---------------------');
writeln;
write('Input Your Reaumur = ');readln(degree);
writeln('Celsius is = ',degree*1.25);
end;
5 : begin
writeln('Celsius To Reaumur');
writeln('---------------------');
writeln;
write('Input Your Celsius = ');readln(degree);
writeln('Reaumur is = ',degree*0.
![Cool 8)](https://www.it4x.com/forum/Smileys/emoticon/cool.gif)
end;
6 : begin
writeln('Celsius To kelvin');
writeln('---------------------');
writeln;
write('Input Your Celsius = ');readln(degree);
writeln('kelvin is = ',degree+273.15);
end;
7 : begin
writeln('kelvin To Fahrenheit');
writeln('---------------------');
writeln;
write('Input Your kelvin = ');readln(degree);
writeln('Fahrenheitr is = ',(degree*1.
![Cool 8)](https://www.it4x.com/forum/Smileys/emoticon/cool.gif)
end;
8 : begin
writeln('Fahrenheit To kelvin');
writeln('---------------------');
writeln;
write('Input Your Fahrenheit = ');readln(degree);
writeln('kelvin is = ',(degree+459.67)/1.
![Cool 8)](https://www.it4x.com/forum/Smileys/emoticon/cool.gif)
end;
else
begin
writeln('Your Unkwon Choice!!')
end;
end;
writeln;
write('Press Any Key To Exit');
readln;
Write('Do you want to Exit (Y/N) = '); readln(ans);
ans:=upcase(ans);
until ans ='Y';
end.
น้องใหม่ ครับ รันผ่านแล้ว แต่ว่าเครื่องผมใช้คำสั่ง เคลียร์ หน้าจอไม่ได้ ก็เลยตัดออก
ติชมได้ครับ