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?
-
What are some of the most important current events that are part of the general subject matter of international economics? Why are they important? How do they affect the economic and political...
-
Consider a single sampling plan with a lot size of 1500, sample size of 150, and acceptance number of 3. Construct the OC curve. If the acceptable quality level is 0.05% nonconforming and the...
-
What is meant by the concept litigation plan?
-
Bennis Corporation was organized on January 1, 2014. It is authorized to issue 10,000 shares of 8%, $100 par value preferred stock and 500,000 shares of no-par common stock with a stated value of $1...
-
Oriole Dental Clinic is a medium-sized dental service specializing in family dental care. The clinic is currently preparing the master budget for the first 2 quarters of 2020. All that remains in...
-
Natalie had a very busy December. At the end of the month, after Natalie has journalized and posted her adjusting entries, her company has the following adjusted trial balance: Instructions Using the...
-
Draw the project network - Find the project time, critical path, and non-critical activities - Develop the project's Gantt chart with both ES and LS times - Find the probability that the project will...
-
Find the sample mean x for each possible sample of size n = 4. Sample 1, 5, 9, 13 X (Type an integer or a decimal rounded to two decimal places as needed.)
-
- Evaluate f (x-2y) dr + (x-y) dy where c is the boundary of the (x-2) first-quadrant of the circle 2 + y = 4.
-
Blossom Inc. issued $ 7 0 0 , 0 0 0 of 9 . 2 5 % , 1 8 - year bonds on January 1 , 2 0 2 3 , at 1 0 1 . Interest is payable semi - annually on July 1 and January 1 . Blossom uses the effective...
-
You just purchased an air conditioning unit for your home that cost you $ 8 0 0 . The shop offered you free home delivery on the unit and a 1 0 % discount on the installation charge of $ 1 0 0 ....
-
Two passenger cars are traveling at 65 MPH on a highway moving in the same direction in the same lane. The cars are separated by 25 feet for every 10 MPH of their speed. The coefficient of friction...
-
Receipt and Payment Account of Shankar Sports club is given below, for the year ended March 31, 2017 Receipts Opening Cash in hand Entrance fees Donation for building Locker rent Life membership fee...
-
The National Collegiate Athletic Association (NCAA) and the National Federation of State High School Associations (NFHS) set a new standard for non-wood baseball bats. Their goal was to ensure that...
-
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...
-
Chef's Catering completed the following selected transactions during May 2020: Required 1. Show whether each transaction would be handled as a revenue or an expense using both the cash basis and...
-
Consider the unadjusted trial balance of Burrows Landscaping at December 31, 2020, and the related month-end adjustment data: The following adjustments need to be made on December 31 before the...
-
Gonzales Sales and Service completed the following transactions during 2020: Required 1. Journalize these entries by debiting an asset account for Prepaid Rent and by crediting a liability account...
Study smarter with the SolutionInn App