#!/usr/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;

print header;
print start_html("Results");

my $temp = param('temp');
if (param('type') eq "c2f") {
   my $ftemp = $temp * 9 / 5 + 32;
   print qq($temp degrees Celsius is $ftemp degrees Fahrenheit.);
} else {
   my $ctemp = ($temp-32) * 5 / 9;
   print qq($temp degrees Fahrenheit is $ctemp degrees Celsius.);
}

print end_html;