Need help with a IF Statment program

Hello everyone, I need some help. I have been braining over this for a day now and it's time for a different view on this problem. I have to create a program that inputs a letter and outputs the corresponding ICAO alphabet word.

Simple enough right. Well I got the program to take a letter and out put its word as long as I use Upper case letters. Now I want to somehow have the program either recognize a lower case letter and print out "please use only uppercase letters" or better yet change the lower case into an upper. How can I do this? May I say I am very novice to all this so forgive me if this seems a stupid question. Thanks

Here is the program I have written sofar:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <iostream>
using namespace std;

int main()
{
	char letter;
	
	cout << "Enter Alphabet letter between A-Z to see ICAO word" << endl << endl;
	cin >> letter;
	cout << endl;
	cout << "Your letter entred is " << "\" " << letter << " \"" << endl << endl;

	cout << "The ICAO word used with corresponding letter is:" << endl << endl;
	
	if (letter == 'A')
		cout << "Alpha";
	else if (letter == 'B')
		cout << "Bravo";
	else if (letter == 'C')
		cout << "Charlie";
	else if (letter == 'D')
		cout << "Delta";
	else if (letter == 'E')
		cout << "Echo";
	else if (letter == 'F')
		cout << "Foxtrot";
	else if (letter == 'G')
		cout << "Golf";
	else if (letter == 'H')
		cout << "Hotel";
	else if (letter == 'I')
		cout << "India"; 
	else if (letter == 'J')
		cout << "Juliet";
	else if (letter == 'K')
		cout << "Kilo";
	else if (letter == 'L')
		cout << "Lima";
	else if (letter == 'M')
		cout << "Mike";
	else if (letter == 'N')
		cout << "November";
	else if (letter == 'O')
		cout << "Oscar";
	else if (letter == 'P')
		cout << "papa";
	else if (letter == 'Q')
		cout << "Quebec";
	else if (letter == 'R')
		cout << "Romeo";
	else if (letter == 'S')
		cout << "Sierra";
	else if (letter == 'T')
		cout <<	"Tango";
	else if (letter == 'U')
		cout << "Uniforms";
	else if (letter == 'V')
		cout << "Victor";
	else if (letter == 'W')
		cout << "Whiskey";
	else if (letter == 'X')
		cout << "X-ray";
	else if (letter == 'Y')
		cout << "Yankee";				
	else if (letter == 'Z')
		cout << "Zulu";
		
	cin.get();
	cin.get();

	return 0;
You could use the #include <cctype> header and use the tolower() [http://www.cplusplus.com/reference/clibrary/cctype/tolower/]
Topic archived. No new replies allowed.