Computer Sciences Department logo

CS 368-1 (2010 Summer) — Day 2 Code Sample

This is the code sample that we worked up in class.

#!/usr/bin/perl

use strict;
use warnings;

# unit conversions!

print "Enter degrees F: ";
# chomp(my $degf = <STDIN>);
my $degf = <STDIN>;

my $degc = ($degf - 32 ) * 5 / 9;

print "Degrees C: $degc\n";