C++.
Write a program that asks the user to enter a single word andoutputs the series of ICAO words that would be used to spell itout. The corresponding International Civil Aviation Organizationalphabet or ICAO words are the words that pilots use when they needto spell something out over a noisy radio channel.
See sample screen output for an example:
Enter a word: program Phonetic version is: Papa Romeo Oscar Golf Romeo Alpha Mike |
The specific requirement is that you write the program so that itdetermines the word corresponding to a specified letterusing a Switch statement instead of an Ifstructure.
As a point of reference, the ICAO alphabet is includedbelow:
A Alpha N November B Bravo O Oscar C Charlie P Papa D Delta Q Quebec E Echo R Romeo F Foxtrot S Sierra G Golf T Tango H Hotel U Uniform I India V Victor J Juliet W Whiskey K Kilo X X-Ray L Lima Y Yankee M Mike Z Zulu |
HINT: You may consider using character(char) array related processing or if you prefer to work withstrings, determine the length of the variable string word anditerate through each letter in the string word using a for loopwith a nested switch statement that has the necessary case labelsmatching the ICAO alphabets. Suggest converting all letters touppercase to match the ICAO alphabet format.
Be sure to use proper formatting and appropriate comments inyour code. Provide appropriate prompts to the user. The outputshould be clearly labeled and neatly formatted.