1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
stiks02 [169]
4 years ago
6

Write a C program that inputs a letter and outputs the corresponding International Civil Aviation Organization (ICAO) alphabet w

ord (these are the words that pilots use when they need to spell something out over a noisy radio channel). Do not use case statements. If you do, you will receive no credit on this assignment! The alphabet is as follows: A Alpha B Bravo C Charlie D Delta E Echo F Foxtrot G Golf H Hotel I India J Juliet K Kilo L Lima M Mike N November O Oscar P Papa Q Quebec R Romeo S Sierra T Tango U Uniform V Victor W Whiskey X X-Ray Y Yankee Z Zulu Be sure to use proper formatting and appropriate comments in your code. Provide appropriate prompts to the user. The output should be labeled clearly and formatted neatly. Be sure to properly comment your code.

Computers and Technology
1 answer:
Andrew [12]4 years ago
7 0

Answer:

Here is the C++ program:

#include<iostream>  //to use input output functions

using namespace std;  //to identify objects like cin cout

int main()  {  //start of main function

char input;  // to store the input letter

string output;   // to store the corresponding ICAO

string ICAO[26] = {"Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf",  "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November",  "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform",  "Victor", "Whiskey", "X-ray", "Yankee", "Zulu"};   // array of ICAO words

cout << "Enter a letter: " << endl;  //prompts user to input a letter

cin >> input;  //reads input letter from user

cout<<"You entered: "<<input<<endl;  // prints the letter input by user

char letter;   //declare a variable to hold the input letter

letter = tolower(input);  //converts the input letter to lowercase

if(isalpha(letter))   //checks if the input is an alphabetic letter

{cout << "The corresponding International Civil Aviation Organization (ICAO) alphabet word: ";  //prints this message

output = ICAO[letter - 'a'];  //computes the corresponding ICAO for input letter

cout << output;  }  //prints the corresponding ICAO of input letter

else  //if input is not a letter

cout << "Error: " << input << " is not a letter!" << endl;  }  //displays this error message

Explanation:

The program first prompts the user to input a letter. It then converts the letter to lower case if the input letter is an uppercase letter. It stores that letter to letter variable. Now it checks whether the letter is an alphabet by using isalpha() method that return true if the letter is an alphabet. If the letter is an alphabet then it computes its corresponding ICAO by looking in to the ICAO array for the input letter. It then displays its corresponding ICAO word. If the value of letter is not an alphabet i.e. when isalpha returns false then else part is executed which displays an error message. The program along with its output is attached in a screenshot.

You might be interested in
How do I get rid of this?
kherson [118]

There Is an App that you downloaded that allows this. you have to find it and disable it

3 0
3 years ago
Read 2 more answers
Suppose for the worst case, given input size n: Algorithm 1 performs f(n) = n2 + n/2 steps Algorithm 2 performs f(n) = 12n + 500
melomori [17]

Answer:

29

Explanation:

for n=28:

--------------

Algorithm 1 performs f(n) = n2 + n/2 = 28*28 + 28/2 = 798

Algorithm 2 performs f(n) = 12*28 + 500 = 836

for n=29

--------------

Algorithm 1 performs f(n) = n2 + n/2 = 29*29 + 29/2 = 855.5

Algorithm 2 performs f(n) = 12*29 + 500 = 848

so, for n=29, algorithm 2 will be faster than algorithm 1

6 0
3 years ago
A Windows user contacted the help desk with a problem that requires the technician to connect to the remote computer using Remot
Yuri [45]

Answer:

Option 4 i.e., RDP, port 3389.

Explanation:

The User has informed the helpdesk with such an issue that involves the specialist to link to the remote server utilizing Remote Assist to access the user's screen with a quite informative and ambiguous error. Every attempt made by the technician to link to the virtual server outcomes in a message saying that the link has been denied.

So the combinations of RDP and port 3389 would be enabled on the remote computer’s firewall to allow this connection.

6 0
3 years ago
Many web pages today use ____ —small text files that are stored on your hard drive by a web server, typically the one associated
elena-14-01-66 [18.8K]
The data of the webpages on the Internet are commonly stored into hard drives from servers around the world. These supercomputers have the capability to store huge chunks of data just to keep the web page from running. The HTTP protocol is the one that allows for these servers to store data.
3 0
3 years ago
Read 2 more answers
What should Kenny do in the following scenario? To hide a toolbar on his taskbar, Kenny right-clicks in an empty space on the to
Georgia [21]

Answer:

Kenny should right-click the taskbar, not the toolbar.

Explanation:

Toolbars on Window’s taskbar are special applications that show on the bottom right of a Desktop display screen by default. The default toolbar options include Desktop, Links, Address, and any other custom toolbars added by the user. To remove or hide a toolbar, Kenny should right click on the taskbar, click on toolbars, and click to activate or untick to hide or the toolbar.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Please help
    14·1 answer
  • Give any 3 examples of mainframe computers .
    10·1 answer
  • Write a function addOne that adds 1 to its integer referenceparameter. The function returns nothing.
    11·1 answer
  • ________ are used to translate each source code instruction into the appropriate machine language instruction.
    11·1 answer
  • Define a romanNumberToInt function that converts a RomanNumber value, which is a list of Roman digits, into an integer. Hints: -
    7·1 answer
  • Write a program that prompts the user to enter the center and a point on the circle. The program should then output the circle’s
    9·1 answer
  • Suppose that the domestic production of computer games creates enjoyment for those who play the games. Domestic production of co
    14·1 answer
  • In 1-2 sentences, describe how to use the thesaurus in the Word Processor you have used.
    7·2 answers
  • Why would an end-user not generally buy a server? Explain your answer by referring to the typical role that servers perform. ​
    12·1 answer
  • In what way can a costume be deleted ?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!