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]
3 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]3 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
Ryan would like to copy a list of contacts from a colleague into his personal address book. The list of contacts is contained in
Yanka [14]

The first thing Ryan should do is to: C. format the text file with comma-separated values and save as CSV file type.

<h3>What is a file?</h3>

A file simply refers to a computer resource that avails end users an ability to store, save, or record data as a single unit on a computer storage device.

Since the list of contacts is contained in a simple text file, formatting the text file with comma-separated values and saving it as a CSV file type should be the first thing Ryan should do in this scenario.

Read more on CSV file here: brainly.com/question/14338529

#SPJ1

6 0
2 years ago
Tom is very curious as to whether terrorism is truly linked to levels of religiosity around the world. As such, he gathers data
Ede4ka [16]

Answer:

Macrosociology

Explanation:

Sociological perspective or perspectives on sociology is an implied definition on how sociologists study and creates theories systematically, through predetermined theories. There are two perspectives sociologists view subject matters, they are macrosociology and microsociology perspectives.

The microsociology perspective describes the symbolic interactionism of individuals as a unit.

The macrosociology perspective studies the functional and conflict theories, which are the interaction of individuals in groups or communities and their impact to the society.

4 0
3 years ago
Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
nata0808 [166]

Answer:

Following are the program for the above question in python:

Explanation:

def seat(num_rows,num_cols):#function definition.

   for x in range(1,num_rows+1):#first for loop.

       c='A'

       for y in range(1,num_cols+1): #second for loop.

           print(str(x)+c,end=" ") #print the value

           c=chr(ord(c)+1) #expression to form a charater addition.

seat(int(input("enter the number of rows: ")),int(input("enter the number of columns: "))) #take the input from the user.

Output:

  • If the user inputs 2 and 3, then the output is :"1A 1B 1C 2A 2B 2C 3A 3B 3C 4A 4B 4C".

Code Explanation :

  • The above code is in python language, in which the first line is used to render a message to the user then take the inputs from the user and then pass to the function after converting into int function.
  • Then there are two loops in the function which are used to print the number of the seat.
  • The first loop is used to print the row number and the second loop is used to print the column number.
4 0
3 years ago
Business cards are generally designed so that this item stands out the most.
Sloan [31]
The D. Company Name most likely stands out on a business card with an address or such in smaller font below. A logo does nothing for a business card if a potential customer doesn't even know the name of the business. While logo's are often present on a business card, the company name is far more crucial to enunciate clearly which is of course, important for business's attraction of new customers.

So D. Company Name is my final answer!

Hope this helps! ;)
3 0
3 years ago
Which types of networks cover large geographical areas such as several states? PAN
aleksley [76]

MAN

Explanation:

Metropolitan Area Network

Local Area Network

Wide area Network

7 0
3 years ago
Other questions:
  • What file would you edit to restrict the number of simultaneous logins a user can employ??
    14·1 answer
  • Jill needs to create a chart for technology club that shows what percentage of total students in the school play video games. Wh
    11·2 answers
  • What is the correct process for inserting a blank worksheet in Google sheets
    12·1 answer
  • Which of the following consists of electronic components that store instructions?
    10·1 answer
  • Match each invention with its effects on the age of exploration.
    6·2 answers
  • Which sign or symbol will you use to lock cells for absolute cell reference
    5·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • Courses that enable students to begin jobs that require course completion certificates are know as
    8·1 answer
  • If you entered data into row 4 and it should be in row 3, you should _____.
    8·2 answers
  • Write a summary of five things that you learned about CSS. Do not copy and paste the information. Summarize each point in your o
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!