Commit bf8c638f authored by ash.brett's avatar ash.brett

Update AssessmentPartThree.java

parent 627199bd
......@@ -21,8 +21,13 @@ 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;
if (theOffset > 26){
theOffset = theOffset%26;
}
else if (theOffset < 0)
{
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()) {
......
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