Friday, December 08, 2006

Error 6: (No compiler message)

Type: Logic
Screenshot: 1 2
Description:
While working on the 'toPigLatin' translater method in my PigLatin program, I found a glaring logic error. Instead of translating properly by moving all in front of the vowel to the back, the program would move the vowel, along with the proper segments, to the back. This error is shown in screenshot #2. I found my error in a for loop in my 'toPigLatin' method, where I initialized the counter in my for loop one value too long and the character saved inside the loop one too small. This problem was solved by moving the '-1' from
chrTemp = Character.toLowerCase( strWords[intCount].charAt(intVCheck - 1));
to the intVCheck initialization in the for loop preceding it,

for(int intVCheck = this.strWords[intCount].length() - 1; intVCheck > 0; intVCheck--)

Friday, December 01, 2006

Error 5: (No compiler message)

Type: Logic
Screenshot: 1
Description: I've had this screenshot a while now, from the GradeAve program and have not managed to remember posting it until now. Basically, in the getCont method of my program, I had alternated the boolean results for Y and N. As a result, when the user inputted Y (for Yes) when asked whether or not to continue, the program would end, and, when the user inputted N (for No), it would continue.