@@ -21,7 +21,8 @@ public class AssessmentPartThree {
...
@@ -21,7 +21,8 @@ public class AssessmentPartThree {
StringBuilderencoded=newStringBuilder();
StringBuilderencoded=newStringBuilder();
//This section of the code creates a new string which is equal the value of theChar
//This section of the code creates a new string which is equal the value of theChar
Stringletter=String.valueOf(theChar);
Stringletter=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
//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
//i is the selected character of the array
for(chari:letter.toCharArray()){
for(chari:letter.toCharArray()){
...
@@ -62,8 +63,7 @@ public class AssessmentPartThree {
...
@@ -62,8 +63,7 @@ public class AssessmentPartThree {
StringBuilderencoded=newStringBuilder();
StringBuilderencoded=newStringBuilder();
//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
//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(inti=0;i<theMessage.length();i++){
for(inti=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
//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
//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
//for example if the value of i is 2 then it will look for the character at 2 in the message