so ... mean moderator i'm back ! (just kidding
)
after a LOT of arguments with the instructors they agreed to extend the period another 10 days ... and now (again) i have 3 days left
so,what i've done so far is this :
import javax.swing.JOptionPane;
class encode {
public static void main(String[] args){
String S;
char SC;
int i=0;
S= JOptionPane.showInputDialog("Input some words:");
while (i<=S.length()-1){
SC= S.charAt(i);
int t = (int)SC;
t+=3;
if( (t>=97) && (t<=122) ){
char Sc = (char)t;
i++;
System.out.print(Sc);
}
else{
t = t-26;
char Sc=(char)t;
i++;
System.out.print(Sc);
}
}
System.out.println("-"+S);
}
}
first off ... it actually works and encode all letters ,good
but the problem i had is i still can't have a successful loop to stop the input .. my program here only takes one input , when i tried to ably,say, do {} while (c !=32); like this :
import javax.swing.JOptionPane;
class encode {
public static void main(String[] args){
String S;
char SC;
int i=0;
int c ;
do {
S= JOptionPane.showInputDialog("Input some words:");
c = Integer.parseInt (S);
} while (c != 32);
(with 32 being the space) ... it doesn't work and although it says process complete it still shows an error in the execution screen :
Capture.JPG
now that the while is misplaced ... i did try to put it in like every line in the code .. same result..i already did encode correctly ,why is this happening to me ?
any ideas what can i use to have a successful loop that asks the user to enter several inputs until he presses "space" ?
though i know you wouldn't help me ... but asking could be worth the try
thanx anyway...