Question
Java Assignment 5 This assignment will focus on the use of loops, String methods and character values. Assignment 5 Submission Follow the directions below to
Java Assignment 5 |
This assignment will focus on the use of loops, String methods and character values. |
Assignment 5 Submission |
Follow the directions below to submit Assignment 5: Create a Java program. The class name for the program should be 'EncryptText'. In the main method you should perform the following: 1.You should read a string from the keyboard using the Scanner class object. 2. You should then encrypt the text by reading each character from the string and adding 1 to the character resulting in a shift of the letter entered. 3. You should output the string entered and the resulting encrypted string. Pseudo flowchart for additional code to be added to the program: 1. After the input string is entered from the keyboard add the following logic. 2. Create a string to hold the lowercase version of the input string. 3. Create a result string to hold the encrypted characters. 4. Loop through each character of the lower case string. 5. The code should read each character of the input string and add 1 to the character so that the character is shifted one position higher in the character sequence. 6. For instance if the input character is an 'a' then the character should be shifted to a 'b'. A 'b' would become a 'c', a 'c' would become a 'd', etc. 7. After you add 1 to the character you should concatenate the character to a result string. 8. Output the string input and the result string. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started