Answered step by step
Verified Expert Solution
Link Copied!

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:

  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

Step: 1

Here I have implemented the code in two parts 1Encrypted the given inputted string as ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions