Re: Help me in java coding
Break the program into simple steps and do them one at a time.
First step:
ask the user a question and get his response.
Then print out his response.
Look at the Scanner class for ways to read the input.
Re: Help me in java coding
I only want to know how to detect the errors of the identifier so that i can create the coding and the produce the "The data contains identifier error".
I only manage to get to the successful data input. But when i input random letters that contains # it still comes out as successful. So i want to know how to detect the identifier error in the coding.
Re: Help me in java coding
Quote:
I only want to know how to detect the errors of the identifier
To do that you need to define the "syntax" for a valid identifier.
Do you have that? What is a valid identifier?
Re: Help me in java coding
example if i input : #alslsl
It would print invalid as it cannot start with the # symbol, % symbol and numbers.
Re: Help me in java coding
To write the code, you need a definition of what the code is to do.
Can you define what a valid identifier is?
Or what an invalid identifier is? Examples are not good enough, unless you can list ALL of the millions of bad identifiers.
Something like this: The first character must be an uppercase letter from A-K, followed by 2 or more numeric digits in the range 4-7 followed by 1 lower case letter in the range: k-m. For example: H445m is valid. H4k is not valid.