Hey guys, I am making something that it takes a char, then it sums it with 5 and returns the new char according to the ASCII table, for example input is 'a' , then output will be 'f'. This code is doing it somewhat ..
public static String Puzzle(String s) {
char[] c = new char[s.length()];
for(int i =0; i<s.length();i++)
c[i] =(char) (s.charAt(i) + 5);
return new String(c);
}
but the problem is that if I get 'z' input for example, my result is not what it has to be since the program should return back from 'a' and forward till count 5 and return the new char. Any ideas how to work around this and keep it so that it loops back the the chars 97-122 (small letters in english)