On 4/8/2012 1:14 AM, xristina4eve wrote:
> Hello, I am completely new in java programming and i would like some
> help with an issue.
>
> I must create a java program which accepts as an input the account
> details of a client. the problem is that the client's code is
> consisted by 3 capital letters and 5 digits. how can i do that as i
> have to check if the user is typing the code with the right way?
Use the methods provided by the Character class:
public static void main(String[] args) throws IOException {
int ch = System.in.read();
System.out.println( "Is upper case: " + Character.isUpperCase( ch ));
System.out.println( "Is digit: " + Character.isDigit( ch ));
}
I'm deliberately not showing you more ideas because this is the sort of
issue you should be talking to your instructor about, or his or her TA,
or the lab assistants. It's important for your instructor to get
feedback on where their students are at and what parts of the lecture
they are retaining. If parts of the coursework aren't being presented
(e.g., methods in the Character class), the your instructor needs to be
aware of that also.