2010-10-29, 10:49 AM
Fiel Wrote:It should be ConjugateVerb, although "Verb" here is redundant. Using the IDE, you'll know you have to pass a verb in, and it's fairly obvious what the method does.
Variables should be lowercaseUppercase
Methods should be UppercaseUppercase
Global constants should be UPPERCASE
Tenses aren't too bad to deal with, but you should have caution now. You do not want to mix data and code as it becomes an unmanageable mess. I don't even like the fact that you have to pass in "irreg" to the command line. Ideally, the user has no fricken clue how to conjugate the verb, and, as such, should not need to know that the verb is irregular. Also, there are some tenses which are irregular for verbs and others which are not. This sounds complicated at first, but once I explain this to you, you should be able to figure out how to do it with some ease.
The idea for how to solve this problem is to create something called a datastore or persistent object. This is a file on your computer - like the WZ files - that remembers data. So, since you have verbs, and each verb HAS A conjugation type, and each conjugation type HAS A list of conjugations, knowing how this works will help you out.
So...
Verb --> tense --> list of conjugations
With each verb requested for a list of conjugations, you look up in the datastore to see if the verb/tense paring is irregular. If it returns nothing, then conjugate it normally. If it returns a list, then show the list instead of conjugating. The real hassle for you is going to be how to create the datastore.
If I were you, I'd do it like this (this is in spanish, but you can figure it out):
Code:[ir,present]
yo=voy
tu=vas
el=va
nosotros=vamos
ellos=van
[ir,pastperfect]
yo=iba
tu=ibas
el=iba
nosotros=ibamos
ellos=iban
Actually, in Java, methods should be camelCase.
http://www.oracle.com/technetwork/java/c...9.html#367
