Question: 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:

  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

3.34 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve the problem of creating a class named EncryptText that reads a string encrypts it by shifting each character and then outputs both the origin... View full answer

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 Programming Questions!