Perhaps the most famous of all coding schemes is the Morse code, developed by Samuel Morse...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Perhaps the most famous of all coding schemes is the Morse code, developed by Samuel Morse in 1832 for use with the telegraph system. The Morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (e.g., period, comma, colon, semicolon). In sound-oriented systems, the dot represents a short sound and the dash a long sound. Other representations of dots and dashes are used with light-oriented systems and signal- flag systems. Separation between words is indicated by a space or, simply, the absence of a dot or dash. In a sound-oriented system, a space is indicated by a short time during which no sound is transmitted. Morse code is a code where each letter of the English alphabet, each digit, and various punctuation characters are represented by a series of dots and dashes. The below Table shows part of the code. CharacterCodeCharacterCodeCharacterCode A B C D E F G H J K L M N -... O P -.. Q R S --. T U .. W -.- X ... Y N -. Digits 1 ..2 ---3 4 5 6 7 8 9 0 Write a program that asks the user to enter an English-language phrase and encodes it into Morse code. Also, the program reads a phrase in Morse code and converts it into the English-language equivalent. Use one blank between each Morse-coded letter and three blanks between each Morse-coded word. Write the above table in a file; load the file at the beginning of the and store morse code in a dictionary. program Your program should print a menu of three options: encode text, decode morse code, or exit a program. The program should process unlimited number of user requests. Your program must have at least 5 functions: A function to print a menu (4 points). A function to load morse code into a dictionary (8 points). A function to convert normal text to Morse code (8 points). A function to convert Morse code to English-language (8 points). The program should validate user input (4 points). A sample run is below. Hello, this program allows you to translate text to morse code or translate morse code Please, select one of the below options: *** Enter 't' for encoding text *** Enter 'm' for decoding morse code *** Enter 'e' to exit the program. My input is: j ***invalid option*** Please enter a valid option: k ***invalid option*** Please enter a valid option: t Please enter text to translate: To Be Or Not To Be Hello, this program allows you to translate text to morse code or translate morse code to text. Please, select one of the below options: *** Enter 't' for encoding text *** Enter 'm' for decoding morse code *** Enter 'e' to exit the program. My input is: y ***invalid option. Please enter a valid option: m Please enter morse to translate: --- -.... TO BE OR NOT TO BE text. Hello, this program allows you to translate text to morse code or translate morse code to text. Please, select one of the below options: *** Enter 't' for encoding text *** Enter 'm' for decoding morse code *** Enter 'e' to exit the program. My input is: e Thanks for using this program! Perhaps the most famous of all coding schemes is the Morse code, developed by Samuel Morse in 1832 for use with the telegraph system. The Morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (e.g., period, comma, colon, semicolon). In sound-oriented systems, the dot represents a short sound and the dash a long sound. Other representations of dots and dashes are used with light-oriented systems and signal- flag systems. Separation between words is indicated by a space or, simply, the absence of a dot or dash. In a sound-oriented system, a space is indicated by a short time during which no sound is transmitted. Morse code is a code where each letter of the English alphabet, each digit, and various punctuation characters are represented by a series of dots and dashes. The below Table shows part of the code. CharacterCodeCharacterCodeCharacterCode A B C D E F G H J K L M N -... O P -.. Q R S --. T U .. W -.- X ... Y N -. Digits 1 ..2 ---3 4 5 6 7 8 9 0 Write a program that asks the user to enter an English-language phrase and encodes it into Morse code. Also, the program reads a phrase in Morse code and converts it into the English-language equivalent. Use one blank between each Morse-coded letter and three blanks between each Morse-coded word. Write the above table in a file; load the file at the beginning of the and store morse code in a dictionary. program Your program should print a menu of three options: encode text, decode morse code, or exit a program. The program should process unlimited number of user requests. Your program must have at least 5 functions: A function to print a menu (4 points). A function to load morse code into a dictionary (8 points). A function to convert normal text to Morse code (8 points). A function to convert Morse code to English-language (8 points). The program should validate user input (4 points). A sample run is below. Hello, this program allows you to translate text to morse code or translate morse code Please, select one of the below options: *** Enter 't' for encoding text *** Enter 'm' for decoding morse code *** Enter 'e' to exit the program. My input is: j ***invalid option*** Please enter a valid option: k ***invalid option*** Please enter a valid option: t Please enter text to translate: To Be Or Not To Be Hello, this program allows you to translate text to morse code or translate morse code to text. Please, select one of the below options: *** Enter 't' for encoding text *** Enter 'm' for decoding morse code *** Enter 'e' to exit the program. My input is: y ***invalid option. Please enter a valid option: m Please enter morse to translate: --- -.... TO BE OR NOT TO BE text. Hello, this program allows you to translate text to morse code or translate morse code to text. Please, select one of the below options: *** Enter 't' for encoding text *** Enter 'm' for decoding morse code *** Enter 'e' to exit the program. My input is: e Thanks for using this program!
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class MorseEncryptDecrypt public static void mainString args Scanner sc new ScannerSystemin SystemoutprintlnPlease enter ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write a function to check if a binary tree is a binary search tree (BST). A BST is a binary tree where for every node, all the nodes in its left subtree are less than the node, and all the nodes in...
-
Morse code, developed in 1832 by Samuel Morse, is one of the most famous of all coding schemes ever developed. Morse code assigns a series of dots and dashes to each letter of the alphabet, each...
-
if we choose statistic as our keyword, our cipher would be determined as follows: method i. write the word statistic without the repeated letters. then complete the cipher with the unused alphabet...
-
What is a self-imposed budget? What are the major advantages of self-imposed budgets? What caution must be exercised in their use?
-
Critically analyze current European and United States industry standards or recommendations for any Information Technology (IT) area or subarea (e.g., intrusion detection, data recovery, data...
-
Homerun Corporation produces baseball bats for kids that it sells for $ 37 each. At capacity, the company can produce 50,000 bats a year. The costs of producing and selling 50,000 bats are: 1....
-
What is a technical review?
-
(Type of Lease, Amortization Schedule) Jacobsen Leasing Company leases a new machine that has a cost and fair value of $75,000 to Stadler Corporation on a 3-year non-cancelable contract. Stadler...
-
What is Preferred Stock? Discuss the characteristics of Preferred Stock over Common Stock. MINIMUM ONE PAGE REQUIREMENT. 2. What are Stock Options? Discuss the TWO primary reasons why corporations...
-
Le Roi du Plastique Sarl has two processes extrusion and thermo-assembly. Consider the June 2022 data for physical units in the thermo-assembly process of Le Roi du Plastique: opening work in...
-
Consider the following set: A {5, 12, 19, 27, 35 42} The cardinality of A is:
-
Which cost flow assumption generally results in the highest reported amount of net income in periods of rising inventory costs? Multiple Choice LIFO. FIFO. Weighted-average. Income will be the same...
-
Alpha company is trying to install a new machine that has estimated cost Rs. 200,000 by replacing an old machine. The new machine required installation cost Rs. 20,000. The expected increase in...
-
(b) Suppose an individual borrows an amount of K28, 300 for 10 months at an interest rate of 9.25%. Calculate (i) The interest due on the loan. (ii) The maturity value at the end of 10 months.. (c)...
-
A simple geometry of a slope is shown in Figure 2, with homogeneous deposit of soft clay on a stiffer clay at the bottom. Properties and thicknesses of the layers are as showed in the figure. a) Use...
-
A retaining wall .X m high was designed to stabilize a horizontal ground surface. The back of the wall is inclined 20 to vertical direction and can be assumed rough with interface friction angle of...
-
How do architectural engineers incorporate the needs and preferences of building occupants into their designs?
-
Determine the volume of the parallelepiped of Fig. 3.25 when (a) P = 4i 3j + 2k, Q = 2i 5j + k, and S = 7i + j k, (b) P = 5i j + 6k, Q = 2i + 3j + k, and S = 3i 2j + 4k. P
-
A restaurant offers a choice of four appetizers, fourteen entrees, six desserts, and five beverages. How many different meals are possible if a diner intends to order only three courses? (Consider...
-
Among mammals, the relationship between the age at which an animal develops locomotion and the age at which it first begins to play has been widely studied. The table below lists onset times for...
-
The diversity of bird species in a given area is related to plant diversity, as measured by variation in foliage heights as well as the variety of flora. Below are indices measured on those two...
-
Calculate the personal savings allowance available in 2023-24 to a taxpayer with taxable income for the year (i.e. net income less any available personal allowance) of: (a) 20,000 (b) 37,701 (c)...
-
Calculate the 2023-24 income tax liability of a non-Scottish taxpayer with taxable income (i.e. income remaining after deducting any available personal allowance) of: (a) 11,730 (b) 15,280 (c) 30,000...
-
In April 2023, HMRC issues a notice requiring an individual to submit a tax return for the year 2022-23. The return is submitted electronically to HMRC on 8 December 2023. (a) State the date by which...
Introduction To Non Parametric Methods Through R Software 1st Edition - ISBN: B0BGNMKK3Q - Free Book
Study smarter with the SolutionInn App