Question: Write a program using Common Lisp that converts a phrase in English to NATO code, and converts a phrase in NATO code to English. The

Write a program using Common Lisp that converts a phrase in English to NATO code, and converts a phrase in NATO code to English. The NATO phonetic alphabet is useful to prevent spelling mistakes or miscommunication, especially when people from different countries with different accents and pronunciations work together. The NATO alphabet became effective in 1956 and, a few years later, turned into the established universal phonetic alphabet for all military, civilian and amateur radio communications. It assigns a word to each letter so that a letters name begins with the letter itself. (https://www.nato.int/cps/en/natohq/news 150391.htm). The table below shows the NATO code for each of the 26 letters in the English alphabet.

A Alfa 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 Xray Z Zulu

Your program must include two functions called: 1) conve, which takes as input a phrase as a list in English and displays its NATO code as a string not a list. 2) convn, which takes as input a phrase as a list in NATO code and displays plain text in English as a string. Your program must run with the function conve and the function convn. Your input must be read and processed recursively as a list. Each word in the phrase must be a sublist of the list. For example to convert from English to NATO code the phrase programming languages, the input must be the list ((P R O G R A M M I N G) (L A N G U A G E S)) The output should be PapaRomeoOscarGolfRomeoAlfaMikeMikeIndiaNovemberGolf LimaAlfaNovemberGolfUniformAlfaGolfEchoSierra To convert NATO code to English the input must be the list ((Papa Romeo Oscar Golf Romeo Alfa Mike Mike India November Golf) (Lima Alfa November Golf Uniform Alfa Golf Echo Sierra)) The output should be programming languages. Your program must be able to process any phrase. Your program must use only recursion. Do not use assignment statements. No variables, arrays, loops, progn allowed. The output must be a string not a list. You must write your own functions whenever possible, instead of using built-in functions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!