Skip to content

The Java program is a Morse Code translator with text-to-Morse Code and Morse Code-to-text conversion options. It uses a predefined map, handles input with a `Scanner`, and ensures case-insensitivity. The program provides a concise and interactive Morse Code conversion tool.

License

Notifications You must be signed in to change notification settings

mayank-bharwal/Morse-Code-Translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Morse-Code-Translator

The Java program is a Morse Code translator with text-to-Morse Code and Morse Code-to-text conversion options. It uses a predefined map, handles input with a Scanner, and ensures case-insensitivity. The program provides a concise and interactive Morse Code conversion tool.

Screenshot 2024-01-07 at 7 39 24 AM

Features

  • Text to Morse Code Conversion: Converts input text to Morse Code, preserving spaces between words.
  • Morse Code to Text Conversion: Translates Morse Code to plain text, considering three consecutive spaces as word separators.

Technical Details

  • Programming Language: Java
  • Dependencies: None
  • Usage: Run the MorseCodeTranslator class, choose an option (1 or 2) for text-to-Morse or Morse-to-text conversion, and follow the prompts.
  • Case Insensitivity: The program is case-insensitive; it converts all input text to uppercase for uniformity.
  • Data Structure: Utilizes a HashMap for efficient mapping between characters and their Morse Code representations.
  • Input Handling: Uses a Scanner for user input and gracefully handles invalid options.

How to Run

  1. Clone the repository.
  2. Compile and run the MorseCodeTranslator class.
javac MorseCodeTranslator.java
java MorseCodeTranslator

Example Usage

Morse Code Translator
1. Text to Morse Code
2. Morse Code to Text
Choose an option (1 or 2): 1
Enter text to translate to Morse Code: Hello World
Morse Code: .... . .-.. .-.. ---   .-- --- .-. .-.. -..

Feel free to explore the Morse Code Translator and enhance its features!

License

This project is licensed under the [ECLIPSE public licenense).

Mayank Bharwal

About

The Java program is a Morse Code translator with text-to-Morse Code and Morse Code-to-text conversion options. It uses a predefined map, handles input with a `Scanner`, and ensures case-insensitivity. The program provides a concise and interactive Morse Code conversion tool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages