NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
The code you've posted looks like a collection of may different attempts to solve the problem and has gotten to be a mess.
Perhaps you should trash it and start over with a new design. Leave out the drawing and GUI stuff and just work on the logic of how to read in the letters and test when you have the correct letters in the correct sequence.
Start with creating new logic and then code it.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
How about starting with a simple version of the program where each WORDi method only needs to read in and accept/validate one or two letters instead of 4. When you get the logic worked out, then you could move to the 4 letters you are trying to process now.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
My suggestion is to start with a simple program, figure out the logic for one letter for each method and when that works, move on to two letters for each method.
When you get that to work, you should have the idea on how to write the logic for more letters.
Good luck.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
No one is going to do your homework for you. Also you should keep in mind many schools automatically search forums and compare them to submitted homeworks. If you plan on taking code from forums you will most likely get caught and in trouble.
I suggest learning how to program and trying to do it yourself first. When you a problem then ask for a few pointers. No one is going to do all of your work for you.
\007
Junior Poster in Training
67 posts since Apr 2011
Reputation Points: 21
Solved Threads: 6
Skill Endorsements: 0
Here's a simple example:
private void aMethod(int x) {
if (x < 10) // Test if the value in range
return; // exit the method if too small
// do other stuff here
} // end aMethod()
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Use ints for numberic data and Strings for string data.
I'm not sure what the "case" is you are talking about.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Please describe in more detail what you want your program to do.
You need to have a design for the program before you write it.
What you have posted now is a mixed up mess.
My suggestion is to start with a simple program, figure out the logic for one letter for each method and when that works, move on to two letters for each method.
When you get that to work, you should have the idea on how to write the logic for more letters.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
WORD1 should return to the calling method when it has received the 4 letters.
The calling method can then call the WORD2 method.
also the WORD1 method could return an error code if there was a problem to tell the calling method about it.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16