anonymous
2009-11-05 13:59:54 UTC
// "pc" is the variable which the user uses to enter the ZIP Code
String pc_upper_case = pc.toUpperCase();
char c1 = pc_upper_case.charAt(0);
char c2 = pc_upper_case.charAt(1);
char c3 = pc_upper_case.charAt(2);
while ( (Character.isLetter(c1) == false) && (Character.isLetter(c2) == false) && (Character.isLetter(c3) == false) )
{
System.out.println ("Re-enter Post code:");
pc = Keyboard.readString();
}
postcode = pc;
(note: variables "postcode" and "pc" are already initialized at the start ;) )
This method is still not working as it is still accepting anything written. Can anyone help? Thanks.