hey guys i have done my codes and its working properly
the only thing that's bothering me is that'
when i input 52 and 'a' as my name, it wont ouput the right answer (it should be 'a' also)
i hope you guys can help me thanks!
public static void main (String args[]){
int encryptor = 0;
String input = " ";
JOptionPane.showMessageDialog(null,"Welcome");
encryptor = Integer.parseInt(JOptionPane.showInputDialog(null,"Please enter number: "));
input =JOptionPane.showInputDialog(null,"Enter Name: ");
String name= "";
for(int i=0;i<input.length();i++){
input.charAt(i);
int x = (int) input.charAt(i);
x=x+encryptor;
if( x > 'z'){ // small letter
x=x-26;
}
else if (x > 'Z' && x < 97){ //big letter
x=x-26;
}
char y = (char) x;
name = name +y;
}
JOptionPane.showMessageDialog(null,name);
}
}