below to translate letters into Morse code. Letter Encoding A, a B, b C, c D, d E, e F. f G, g H, h I, i - -.-. ... --. .... .. Letter Encoding J, j K, k L, 1 M, m N, n 0,0 P, p Q,9 R, r --- -.- -- -. -- --- .-. Letter Encoding S, s T, t U, u V, V W, W X, X Y, y Z, z ... .. .- -..- -.-- --..
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
Add the ability to convert an entire message into Morse code, as well as the ability to handle a data file comprising numerous entries. Change your input validation code so that the user has an infinite number of opportunities to enter valid responses. Your program should run until the user selects the "quit" option from your menu.
- Add a menu option to provide the user the option of processing a data file. Add another way to exit the program. When your software starts, the menu should be the first item that appears. The menu format should be the same as in the Sample Output.
- Allow the user to make more menu selections until they select the option to exit. Before soliciting the user for a menu selection, always show the menu. Handle an incorrect menu option correctly. The user should have an infinite number of opportunities to enter a valid menu option.
- Validate the user's input for the number of words sent so that numbers less than one are not accepted. Allow the user an unlimited number of attempts to enter a proper figure for the number of words sent.
- Modify the code from Project 2 to convert a single letter to Morse code. Your code should now be able to efficiently transform any length message into Morse code. All white spaces in the message should be converted into three Morse code white spaces.
- If any part of the message cannot be translated into Morse code, your code should display the untranslated character rather than an error message.
- Add functionality to create and display telegram bills by reading input from the TelegramData.txt text file. When the user selects the option to process a data file, telegram bills should be created and displayed for every record in the file without the user needing to do anything else. See the Sample Output for what the bill must contain. The TelegramData.txt file contains 5 records, but your program must be able to process an identically formatted file with any number of records without counting the records.
Sample Output (user response shown in bold)
Welcome to Western Union Telegraph Company
1 – Process Telegram Bill
2 – Translate to Morse code
3 – Process a Data File
4 - Quit
Enter your choice: 2
Enter a message: That’s it!
Translation: - . . . . . - - ‘ . . . . . - !
Welcome to Western Union Telegraph Company
1 – Process Telegram Bill
2 – Translate to Morse code
3 – Process a Data File
4 - Quit
Enter your choice: 3
Leslie Knope
1456 Plymouth Street
Pawnee, IN 47408
Amount Owed: $35.50
Tom Haveford
689 Lil Sebastian Avenue
Pawnee, IN 47408
Amount Owed: $11.00
April Ludgate
1123 9th Avenue
Wamapoke, IN 48034
Amount Owed: $18.00
Jery Gergich
3124 Woodbridge Road
Eagleton, IN 47322
Amount Owed: $114.00
Donna Meagle
1200 Elysian Fields Blvd
Eagleton, IN 47322
Amount Owed: $73.50
Welcome to Western Union Telegraph Company
1 – Process Telegram Bill
2 – Translate to Morse code
3 – Process a Data File
4 - Quit
Enter your choice: 4
Thank you for using our program.