/*	~jhowell/first_while.cpp		9/18/01			Drawer 76
		To introduce "while" loops
	
	To be modified to introduce a counter, and "nesting" 
*/

#include <iostream.h>

int main ( )
{
	int range, target, guess;
	int counter;
	
	cout << "This program requires two users."<<endl;
	cout << "One enters a target number; the other must guess it.\n";

	cout << "User 1: Over what range would you like me to choose? 1 - .. ? ";
	cin  >> range;
	
	cout << "User1: look away\nUser 2: Enter the target number: ";
	cin  >> target;
	
	cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";	
	cout << "User 1: ";
	
	cout << "What is your guess? ";
	cin  >> guess;
		
	while (target != guess)
	{
		if (guess > target)
		{
			cout << "Your guess was too high; ";
		}
		else
		{
			cout << "Your guess was too low;  ";
		}

					
		cout << "What is your next guess? ";
		cin  >> guess;
	}

	cout <<  "Congratulations.  You got it."<< endl;
	return 0;
}

