Question: For this assignment, you are to create a program in Java that allows the user to encode the sum of 5 numbers using the Caesar

For this assignment, you are to create a program in Java that allows the user to encode the sum of 5 numbers using the Caesar Code, as shown above. You are to work on this assignment independently. The program will work as follows:

1. Ask the user to enter 5 integers in the range from 0 to 19 (inclusive). If they enter a number outside of this range, display the message "Please read directions and try again!" and terminate the program.

2. Sum these 5 numbers and store it in a variable. This will be your plaintext (the unencoded number).

3. Create a random integer in the range of 0 to 9 (inclusive). This will be your key for the encoding. Display this key to the user.

4. Encode each digit of the plaintext separately using the Caesar Code (see above). The encoded number should be 2 digits (even if plaintext is only 1 digit).

5. Display the encoded number to the user.

Additional Requirements

1. The name of your Java Class that contains the main method should be Cipher. All your code should be within the main method.

2. Your code should follow good coding practices, including good use of whitespace (indents and line breaks) and use of both inline and block comments.

3. You need to use meaningful identifier names that conform to standard Java naming conventions.

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!