Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The class name for the program should be 'EncryptText'. In the main method you should perform the following: You should read a string from the
The class name for the program should be 'EncryptText'.
In the main method you should perform the following:
- You should read a string from the keyboard using the Scanner class object.
- 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.
- You should output the string entered and the resulting encrypted string.
Pseudo flowchart for additional code to be added to the program:
- After the input string is entered from the keyboard add the following logic.
- Create a string to hold the lowercase version of the input string.
- Create a result string to hold the encrypted characters.
- Loop through each character of the lower case string.
- 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.
- 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.
- After you add 1 to the character you should concatenate the character to a result string.
- Output the string input and the result string.
Step by Step Solution
★★★★★
3.34 Rating (166 Votes )
There are 3 Steps involved in it
Step: 1
Here I have implemented the code in two parts 1Encrypted the given inputted string as ...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