Question: Western Cipher.java You should import java.io.*; in this class This class represents a cipher that can encode and decode information with the algorithm provided above.

 Western Cipher.java You should import java.io.*; in this class This classrepresents a cipher that can encode and decode information with the algorithm

Western Cipher.java You should import java.io.*; in this class This class represents a cipher that can encode and decode information with the algorithm provided above. It must have the following private variables: encodingQueue (CircularArrayQueue, type Character) decodingQueue (CircularArrayQueue, type Character) The class must have the following public methods: WesternCipher (constructor) - No parameter constructor, it initializes both the encoding and decoding queues with a capacity of 10 and as type Character Western Cipher (constructor with argument) - Takes an integer as input and initializes both the encoding and decoding queues with the capacity provided and as type Character encode(String input) - Takes a string as input, splits the string into individual characters, applies the Western Cipher algorithm described above, rejoins the individual characters into a string and returns it. While possible to implement without a queue, this method must enqueue every character into the queue and then encode while dequeueing. decode(String input) - Takes a string as input, splits the string into individual characters and undoes the Western Cipher algorithm described above. It then rejoins the individual decoded characters, gathers them into a string and returns it. While possible to implement without a queue, this method must enqueue every character into the queue and then decode while dequeueing. Main method - This requirement is not assessed in the tests. The main method must prompt the user about whether it would like to encode or decode a string, take the string and encode/decode as appropriate, and then prompt the user if they would like to enter another string. If no is selected, the program should exit. Hints: Look at the provided cipher code for a starting point. You will need to remember % You can do integer math by converting the starting character 'A' or the ending character Z and adding or subtracting the appropriate number of letters to move. The decoder has to undo the encode operations exactly. Western Cipher.java You should import java.io.*; in this class This class represents a cipher that can encode and decode information with the algorithm provided above. It must have the following private variables: encodingQueue (CircularArrayQueue, type Character) decodingQueue (CircularArrayQueue, type Character) The class must have the following public methods: WesternCipher (constructor) - No parameter constructor, it initializes both the encoding and decoding queues with a capacity of 10 and as type Character Western Cipher (constructor with argument) - Takes an integer as input and initializes both the encoding and decoding queues with the capacity provided and as type Character encode(String input) - Takes a string as input, splits the string into individual characters, applies the Western Cipher algorithm described above, rejoins the individual characters into a string and returns it. While possible to implement without a queue, this method must enqueue every character into the queue and then encode while dequeueing. decode(String input) - Takes a string as input, splits the string into individual characters and undoes the Western Cipher algorithm described above. It then rejoins the individual decoded characters, gathers them into a string and returns it. While possible to implement without a queue, this method must enqueue every character into the queue and then decode while dequeueing. Main method - This requirement is not assessed in the tests. The main method must prompt the user about whether it would like to encode or decode a string, take the string and encode/decode as appropriate, and then prompt the user if they would like to enter another string. If no is selected, the program should exit. Hints: Look at the provided cipher code for a starting point. You will need to remember % You can do integer math by converting the starting character 'A' or the ending character Z and adding or subtracting the appropriate number of letters to move. The decoder has to undo the encode operations exactly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!