/*
Write a C++ program to do the following 
(1) It reads in a character and displays the alphabetical 
order of the character if the character is a lowercase letter 
or an uppercase letter and displays "Not a Letter"  if the 
character is not a letter. For example, if the input is f, 
then your program should display 6. If the input is F, then 
your program should display 6. If the input is 8, then your 
program should display "Not a Letter".
(2) Then it asks the user whether he/she wants to continue. 
If the user enters y or Y, then it repeats the whole process. 
If the user enters something else, it stops executing.
*/

#include<iostream>
using namespace std;
int main()
{
    char ch = 'y', c, C;
	while (toupper(ch) == 'Y')
	{
		cout << "Enter a character: ";
		cin >> c;
		C = toupper(c);
		if (C >= 'A' && C <= 'Z')
		{
			cout << "\tThe alphabetical order of "
				<< c << " is " << C - 64 << ".\n";
		}
		else
			cout << "Not a Letter" << endl;
		cout << "Continue? If yes, press y or Y: ";
		cin >> ch;
	}

	system("pause");
	return 0;
}    
