//write a program that will convert from degrees Centigrade to degrees Fahrenheit
//and converts from F to C.  There should be a console menu for choosing which
// conversion to do and a third option to finish the program.
//F= 32+9/5*C.    Test C=0;C=-40; C=100;
//C=(F-32)*5/9
#include <iostream>
using namespace std;
int main(void)
{
	float C;  //centigrade
	float F; //fahrenheit
	int choice = 1;
	while (choice != 3)
	{
		cout << "please enter choice" << endl;
		cout << "1:Cent to Fahren\n";
		cout << "2:Fahren to Cent\n";
		cout << "3:exit\n";
		cin >> choice;

		if (choice == 1)
		{
			cout << "please enter temp (degrees C)" << endl;
			cin >> C;
			F = 32.0 + 9.0 / 5.0*C;
			cout << "Temp in F is " << F << endl;
		}
		if (choice == 2)   //>, <, >=,  <=  &&, ||, &, |
		{
			//F->C
			cout << "please enter temp (degrees F)" << endl;
			cin >> F;
			C = 5.0*(F - 32.0) / 9.0;
			cout << "Temp in C is " << C << endl;

		}
		if (choice == 3)
		{
			//end program
			cout << "Bye\n";
		}
		system("pause");
		system("cls");
	}
	return 0;
}
