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--)
No comments:
Post a Comment