Home > General > Centigrade to Fahrenheit

Centigrade to Fahrenheit

{-----------------------------------
Program: Cent2Fahr
Author:  http://www.pascalprogramming.info
Version: 1.4
Last Modified: 23/09/08
-----------------------------------}

program cent2fahr; {program to convert centigrade to fahrenheit}

uses wincrt;

const

     space = '  ';
     head  = '##################'; 

var
   temp  :real;
   enter :string;

begin {start cent2fahr}

      {start screen }
     gotoxy(30,0);
      writeln( head );
     gotoxy(32,2);
      writeln( '.:Cent2Fahr:.' );
     gotoxy(33,3);
      writeln( 'Version 1.0' );
     gotoxy(32,4);
      writeln( 'By http://www.pascalprogramming.info' );
     gotoxy(30,5);
      writeln( head );
     gotoxy(29,7);
      write( 'Press enter to start' );
      readln( enter );
      {end start screen}

     clrscr;

      {main program}
     writeln( '' );
     write( 'Please enter today''s temperature in centigrade',space );
     read( temp );
     if temp < -273 then
        begin
             write( 'This temprature does not exist!' );
        end
     else
        begin
             write( 'Today''s temperature in Fahrenheit is:',space );
             temp := ((temp/5)*9)+32;
             writeln( temp:5:2 );
             writeln( 'Thanks for using Cent2Fahr' );
        end;
      {end main program }

end. {end cent2fahr}
Categories: General Tags:
  1. No comments yet.
  1. No trackbacks yet.