there are 3 ciphers but if somebody could help me with at least one of those that would be awesome.
A Caesar Cipher with a left shift of 3.
A Substitution Cipher using the setup available in the notes.
The Vigenere Cipher
Implementation To begin, in the video above I have given you an interface called "TranslationMatrix". This interface has a single method called Translate which takes in an array of String objects. Each string object should be a single word. Using this interface you will need to make a class to handle each of the three cipher’s listed above. Once you have the three classes set up using the interface, you will need to create a class called Translator with the following methods: public Translator( TranslationMatrix m): A constructor that takes in an object of type TranslationMatrix. public String translateText(String text): This method will do the actual translation. The text will need to be broken up into individual words. To help with this, you should take a look at the split() method in the String class. Once you have the text broken up into single words in an ArrayList, you should send the array list to be translated by a class that acts as a TranslationMatrix. Finally, you should return the translated text as a string. The last class you create will be Cipher.java which will serve as your main. This class should ask the user which cipher they want and once a cipher is selected instruct them to enter the text to be translated. The main will then call the translateText method of the Translator class and then output whatever this method returns. The program will then ask for another piece of text to translate and repeat the process of translating the text with the same cipher. This loop will end when the filepath is "quit" (without the quotes).
there are 3 ciphers but if somebody could help me with at least one of those that would be awesome. A Caesar Cipher with
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am