/*	~jhowell/guees_if.cpp		9/24/01			Drawer 76
		To motivate the introduction of "while" loops
*/

#include <iostream.h>

int main ( )
{
	int range, target, guess, guess_count;
	
	cout << "This program requires two users."<<endl;
	cout << "One enters a target number; the other must guess it.\n";
	
	cout << "User1: look away\nUser 2: Enter the target number from 1-12: ";
	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: ";
	guess_count = 0;
	cout << "What is your guess? ";
	cin  >> guess;
   guess_count = guess_count + 1;
   	
	if (guess != target)
	do
	{	
		cout << "Nope. What is your next guess? ";
		cin  >> guess;
		guess_count = guess_count + 1;
	} while (guess != target);
				
	cout << "Congratulations.  You got it in "<<guess_count<<" guesses \n";

	return 0;
}

