QUOTE(kyleryansmith@hotmail.com @ 31 Jan, 2008 - 05:08 PM)

CODE
import javax.swing.*;
public class Question4
{
public static void main (String [] args) throws IOException
{
boolean test;
System.out.println("Enter a character");
test = Character.isLetter (letter);
char letter = JOptionPane.showInputDialog.charAt(0);
if ( Character.toUpperCase (letter) >= 'A' && Character.toUpperCase (letter) <= 'Z')
{
System.out.println( letter + " Is a letter");
}
else //[u] i don't know how to put the isDigit here?[/u]
}
System.out.println( letter + " Is a digit");
}
{
//i have to create a white space here but don't know how to do that?
}
//i could either put the isdigit is the else but i wanted to maybe put it in a separate method.
public static boolean isDigit ( int Letter )
{
if ( letter = isDigit )
{
System.out.println ( letter + "Is a digit");
}
// what i want this program to do is to test if letter is a letter, a digit or a white space, if its a digit i need the digit to be square rooted and then out putted.
for a space try if (letter = " ")
for a digit try if(letter=>0 and letter=<9) then convert the string to an int and do your print line
don't just run the else as a digit becasue there are characters other than letters and numbers