// Yes/No test
// Date 20:55 29/10/2016
// By Ben a.k.a DreamVB

#include <iostream>
#include <time.h>

using namespace std;
using std::cout;
using std::endl;

int main(int argc, char *argv[]){
	char ans('Y');
	int rnd(0);

	srand(time(0));

	while (ans == 'Y'){
		//Just display a random number for the user.
		rnd = 1 + rand() % 1024;
		cout << "Here is your random number " << rnd << endl;
		cout << "Want to show a new random number (y/n) : ";
		//Get user choice
		cin >> ans;
		//Conv to uppercase
		if (ans >= 'a'){
			ans = (char)(ans - 32);
		}

		if (ans == 'N'){
			cout << "Thanks for trying the program." << endl;
		}
		if (ans != 'Y' && ans != 'N'){
			cout << "Invaild choice " << "'" << ans << "'" << " aborting." << endl;
		}
	}

	system("pause");
	return 0;
}