Commit 627199bd authored by ash.brett's avatar ash.brett

Update AssessmentPartThree.java

parent 07fb80e7
......@@ -21,7 +21,8 @@ public class AssessmentPartThree {
StringBuilder encoded = new StringBuilder();
//This section of the code creates a new string which is equal the value of theChar
String letter=String.valueOf(theChar);
//this sets the int theOffset to be equal to theOffset divided by 26 plus 26
theOffset = theOffset % 26 + 26;
//This section of the code creates a char called i and converts the string Letter to an array of characters
//i is the selected character of the array
for (char i : letter.toCharArray()) {
......@@ -62,8 +63,7 @@ public class AssessmentPartThree {
StringBuilder encoded = new StringBuilder();
//The section of the code creates the int i and sets its value to 0. And then says for each time i is less than the length of the String theMessage run the code below and increment i by one
for (int i=0; i < theMessage.length(); i++) {
//this sets the int theOffset to be equal to theOffset divided by 26 plus 26
theOffset = theOffset % 26 + 26;
//this creates a char called letter and sets it to be equal to theMessage character at i
//i is used to work out the char of the message
//for example if the value of i is 2 then it will look for the character at 2 in the message
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment