Please send questions to
st10@humboldt.edu .
// Contract: main: void -> int
// Purpose: interactively ask user for Fahrenheit temperatures
// to convert to until user indicates he/she is done;
// for each Fahrenheit temperature entered, print its
// Celsius equivalent to the screen in a descriptive
// message
//
// Examples: not applicable (too interactive)
//
// by: Sharon M. Tuttle
// last modified: 11-8-05
#include <iostream>
#include "fahr_to_cels.h"
using namespace std;
int main()
{
char answer;
double next_fahr_temp;
cout << "Do you want to enter a Fahrenheit temperature? "
<< endl;
cout << " (type y for yes, anything else for no)" << endl;
cin >> answer;
while (answer == 'y')
{
cout << "Enter Fahrenheit temperature: ";
cin >> next_fahr_temp;
cout << "...is " << fahr_to_cels(next_fahr_temp)
<< " in Celsius." << endl;
cout << endl
<< "Do you want to enter another Fahrenheit "
<< "temperature? " << endl
<< " (type y for yes, anything else for no)"
<< endl;
cin >> answer;
}
return EXIT_SUCCESS;
}