
% Homework 1 Solutions
% convert.m
% CS 1109, Summer 2011
% July 13

% This script prompts the user to enter a temperature in degrees
% Fahrenheit, converts it to Celsius and prints the result to the screen.

fahrenheit = input('Please enter the temperature in degrees Fahrenheit: ');

fprintf('%.1fF is equivalent to %.1fC\n', fahrenheit, ...
    (fahrenheit - 32) * 5 / 9);

% Common mistakes:
%
% 1) Some did not print out the measurements with the correct amount of
% precision. Observe how this is done above. The `.1' between the % and f
% indicates that you would like 1 digit of precision after the
% decimal point.
%
