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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
#include <iostream>
#include <iomanip>
#include <string>
#include <cctype>
#include <algorithm>
using namespace std;
void GetString (string& stringin);
int main()
{
string stringin;
GetString (stringin);
cin.get();
cin.get();
return 0;
}
void GetString (string& stringin)
{
cout << "Please enter string or press 9 to exit: " << endl;
cout << endl;
cin >> stringin;
if (stringin == "9")
return;
cout << "The phonetic version is: " << endl;
cout << endl;
while (stringin != "9")
{
if(stringin == "A", "a")
cout << "The letter A is Alpha " << endl;
else
if(stringin == "B", "b")
cout << "The letter B is Bravo " << endl;
else
if (stringin == "C", "c")
cout << "The letter C is Charlie " << endl;
else
if(stringin == "D", "d")
cout << "The letter D is Delta " << endl;
else
if(stringin == "E", "e")
cout << "The letter E is Echo " << endl;
else
if (stringin == "F", "f")
cout << "The letter F is Foxtrot " << endl;
else
if (stringin == "G", "g")
cout << "The letter G is Golf " << endl;
else
if(stringin == "H", "h")
cout << "The letter H is Hotel " << endl;
else
if(stringin == "I", "i")
cout << "The letter I is India " << endl;
else
if(stringin == "J", "j")
cout << "The letter J is Juliet " << endl ;
else
if(stringin == "K", "k")
cout << "The letter K is Kilo " << endl;
else
if(stringin == "L", "l")
cout << "The letter L is Lima " << endl;
else
if(stringin == "M", "m")
cout << "The letter M is Mike " << endl;
else
if (stringin == "N", "n")
cout << "The letter N is November " << endl;
else
if(stringin == "O", "o")
cout << "The letter O is Oscar " << endl;
else
if(stringin == "P", "p")
cout << "The letter P is Papa " << endl;
else
if(stringin == "Q", "q")
cout << "The letter Q is Quebec " << endl;
else
if(stringin == "R", "r")
cout << "The letter R is Romeo " << endl;
else
if(stringin == "S", "s")
cout << "The letter S is Sierra " << endl;
else
if(stringin == "T", "t")
cout << "The letter T is Tango " << endl;
else
if(stringin == "U", "u")
cout << "The letter U is Uniform " << endl;
else
if(stringin == "V", "v")
cout << "The letter V is Victor " << endl;
else
if(stringin == "W", "w")
cout << "The letter W is Whiskey " << endl;
else
if(stringin == "X", "x")
cout << "The letter X is X-ray " << endl;
else
if(stringin == "Y", "y")
cout << "The letter Y is Yankee " << endl;
else
if(stringin == "Z", "z")
cout << "The letter Z is Zulu " << endl;
else
cout << "Letter entered was not alphabetic " << endl;
}
}
|