Source Code for Lab #3
//
// lab03.cpp. This program reads a temperature in Fahrenheit
// and calculates the equivalent Celsius temperature.
//
#include <iostream>
using namespace std ;
int main(void)
{
/*
The variables Fahrenheit and Celsius below are int's. DON'T CHANGE
THEM to anything else. In particular, do not change them into
double or float.
*/
int Fahrenheit, // temperature in Fahrenheit
Celsius; // temperature in Celsius
cout << "\nThis program converts a temperature in" << endl ;
cout << "Fahrenheit to Celsius and vice versa." << endl ;
cout << "All measurements are in whole numbers." << endl << endl ;
cout << "Please enter a Fahrenheit temperature: ";
cin >> Fahrenheit;
/*
The assignment statement below computes the Celsius temperature
corresponding to the Fahrenheit temperature, and stores the value into
the variable called Celsius.
Fill in the formula needed on the Right Hand Side below.
*/
Celsius = ;
cout << Fahrenheit << " degrees Fahrenheit = "
<< Celsius << " degrees Celsius" << endl << endl;
return 0;
}