Before trying to write code, you should work on the logic for the program. Work on making a list of the steps the program should do in pseudo code. When the logic looks good, then try writing the...
Type: Posts; User: Norm
Before trying to write code, you should work on the logic for the program. Work on making a list of the steps the program should do in pseudo code. When the logic looks good, then try writing the...
How will you detect when testing the end of the sequence of letters? With this String: "bazyx" you will need to know when at the end of the sequence to know to wrap around to the end of the...
Instead of using 'a' in the code that tests for the first char of the group of letters: a-z or digits: 0-9, use a variable of type char that holds either 'a' or '0'
Define some variables to hold controlling values and use them instead of hardcoding: 'a', 'z', '0', '9' etc
You could determine ascending/descending by looking at the first two char
Not very reliable for Strings more than 2 char long. I don't see how testing the first and ending char of the String wold tell you what was in between the first and last char.
How are you going...
When you look at the first char what is the first test you need to make?
Some thoughts:
To detect if ascending see if next is +1 in value
to detect descending see if next is -1 in value
Special...
start simple: get the char before the current char and test it, then get the char after the current char and test it. Move to next char.
Don't try to do it all at once.
--- Update ---
Make a...
I assume the input is in a String. Use the charAt() method to get the char values out of the String.
Use a loop and if statements inside the loop to do the tests.
--- Update ---
char values in...
Are these the rules: if looking at 'a' then 'z' and 'b' are consecutive. For 'd', 'c' and 'e'. For '0', '9' and '1'