Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USE JAVA only, please. Thank you. Note: The encrypt() method of MorseCipher should be relatively short (20ish lines) and be fairly easy to follow. Commenting

USE JAVA only, please. Thank you.image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Note: The encrypt() method of MorseCipher should be relatively short (20ish lines) and be fairly easy to follow. Commenting is a must, as always.

The decrypt() method is trickier. It involves some significant looping, conditionals, and cleverness, or extra familiarity with the String class. Make your code as clean as possible and include comments to describe your approach in each section. Line by line descriptions are not needed, but comments like "find the character that matches the code", "check whether code is finished" and "advance past spaces" help a reader to discern what each portion is doing. Show off your communication skills - much of writing code is actually about communicating to the next programmer, not to the computer!

Test cases to pass: https://repl.it/@tom_don/CuteFaroffDirectories

class MorseCipher Morse code is actually a cipher with encryption and decryption actions. Unusually, the intent is not to hide information, merely to represent it in a form more suited for transit. By representing letters with dashes and dots, it is easy to transmit data through lossy environments such as transmission across wires The project pack contains a start for MorseCipher.java which defines the alphabet we will use along with the Morse codes associated with the those letters You will implement the same encrypt() and decrypt() methods as before. Other than the series of dots and dashes representing each letter, we see three spaces separating each letter of a word and seven spaces separating words. There are no spaces at the end of the message. We must create exactly the correct amount of spacing in our encrypted messages, and we must correctly extract the letters and spaces when decrypting Fields Due to the possibility of transcription errors, these two definitions are provided directly (and in the provided files) public static final string lettersABCDEFGHIJKLMNOPORSTUVWXYZ1234567890"; public static final Stringcodes1 " " , /*H T *

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions