/* temperature2.cpp converts a temperature from Fahrenheit to 
Celsius,
 * using a conversion function named FahrToCelsius().
 *
 *  Input:  tempFahrenheit
 *  Output: tempCelsius
 
*********************************************************************
*/

#include <iostream.h>      	     // cin, cout, <<, >>

double FahrToCelsius(double tempFahr);          // function prototype

int main()
{
   cout << "This program converts a temperature\n"
           "from Fahrenheit to Celsius.\n";

   cout << "\nEnter a Fahrenheit temperature: ";
   double tempFahrenheit;
   cin >> tempFahrenheit;

   double tempCelsius = FahrToCelsius(tempFahrenheit);

   cout << tempFahrenheit << " degrees Fahrenheit is equivalent to "
        << tempCelsius << " degrees Celsius\n";

   return 0;
}  

/* FahrToCelsius converts a temperature from Fahrenheit to Celsius.
 *
 * Receive: tempFahr, a Fahrenheit temperature
 * Return:  the equivalent Celsius temperature
 
********************************************************************/
double FahrToCelsius(double tempFahr)         // function definition
{
   return (tempFahr - 32.0) / 1.8;
}


