Question: Problem: You are to write a program in Java that takes in as input a string message and an integer. The program will then scramble

Problem: You are to write a program in Java that takes in as input a string message and an integer. The program will then scramble the message by converting each character of the message to its numeric code, adding the specified integer to this code, then converting the resulting number back to a character. To do this, you must create a class that handles a string and the encoding integer as inputs.
Required Class Variables: You need a string to hold the message, and a variable of type into to hold the value to encode the message with.
Required Member Methods:
getMessage: reads in and stores the message string
getCode: reads in and stores the encoding value
encrypt: takes in a single letter as input and returns a result of type char
encryptAll: uses a loop to go through the string and encrypt the contents using encrypt function
printOut: Prints out the contents of the converted array message
For example, on a computer the following ASCII text:
THE REDCOATS ARE COMING!
Followed by an integer of 5 would produce the following:
YMJ WJIHTFYX FWJ HTRNSL&
What to turn in: Turn in a copy of your source code along with screen shots of the program in action by copying and pasting them in a document and upload it to Canvas.

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!