Please convert this Java code to Pseudocode and decoder method : public String encoder (String text , int key) { char[] uCase = { 'A','B' , 'C', 'D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char[] lCase = { 'a' , 'b' , 'c', 'd','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; String cipher = " "; for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (char.isUpperCase(c)) { for (int j = 0; j < uCase.length; j++) if (c.equals(uCase[j]) ) { cipher = cipher + uCase[(j+key)]; } } else { for (int j = 0; j < lCase.length; j++) { if (c.equals(lCase[j])) cipher = cipher+ lCase[(j+key)]; } } } return cipher ; }
Please convert this Java code to Pseudocode and decoder method :
public String encoder (String text , int key) {
char[] uCase = { 'A','B' , 'C', 'D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char[] lCase = { 'a' , 'b' , 'c', 'd','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
String cipher = " ";
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (char.isUpperCase(c)) {
for (int j = 0; j < uCase.length; j++)
if (c.equals(uCase[j]) ) {
cipher = cipher + uCase[(j+key)];
}
}
else {
for (int j = 0; j < lCase.length; j++) {
if (c.equals(lCase[j]))
cipher = cipher+ lCase[(j+key)];
}
}
}
return cipher ;
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps