///////
//
// Student: RussellLowke
//     T.F: Francis Crick
// Unit Two, Easy Supplementary - question 16 [worth 3pts],  7/1/2002
//
//  Write a program that prompts user for a temperature between -20
//  and 110 gegrees fahrenheight.  Tell user what sports can be played,
//  according to chart.

#include <iostream>

void main()
{

	// declare vars and initialize
	
	int     myTmptre =  0;  // temperature
	char    tryAgain = 'Y'; // loop while tryAgain = 'Y'
	
	// main loop
	do {
	
		// ask for valid temperature outside
		do {
			cout << endl << "OK, mate, what's the temperature outside? ";
			cin >> myTmptre;
		 
			// check temperature
			if (! (myTmptre >= -20 && myTmptre <= 110) ) {
				cout << " Temperature must be a value between -20 and 110.";
			}
		} while (! (myTmptre >= -20 && myTmptre <= 110));
		
		// print result
		cout << endl << "Looks good for...";
		
		if (myTmptre >= 75)                    // Swimming
			cout << "	Swimming";
		
		if (myTmptre > 60 && myTmptre <= 85)   // Tennis
			cout << "	Tennis";
		
		if (myTmptre >10 && myTmptre <= 32)    // Skiing
			cout << "	Skiing";
		
		if (myTmptre <= 10)                    // Checkers
			cout << "	Checkers";
		
		if (myTmptre > 32 && myTmptre <= 70)   // Soccer
			cout << "	Soccer";
		 
		// finish up
		cout << endl << endl;
		 
		do {
			// Try again?
			cout << "Want to try again? (y/n)";
			cin >> tryAgain;
		} while (! (tryAgain == 'N' || tryAgain == 'n' ||
					tryAgain == 'Y' || tryAgain == 'y'));
	} while (tryAgain == 'Y' || tryAgain == 'y');
}