Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help?

Name: Anonymous 2012-10-14 0:12

Could someone please explain why these two codes give different results for the 'Grade' output. In the first code, it will give me all F's if i have an average of an F grade first. But the second code will return the correct Grade values if I use the same inputs.

The values I am using in both codes:
testOne: 50, 80, 70, 100
testTwo: 50, 80, 70, 100

Why is the code with specific array values {'A', 'B', 'C', 'F'} giving me the incorrect grade outputs?

Isn't saying average[i] = letterGrade[0], the same thing as assigning average[i] = 'A', if letterGrade[0] were to equal 'A'?

http://ideone.com/mSwRt

http://ideone.com/vI6ZU

Name: Anonymous 2012-10-14 0:41

>>1
Are you really this dumb? You're changing `letterGrade[i]' for i in [0..3] by reading back from `letterGrade[n]' to do so. What happens when your first average is in the F range? You essentially say letterGrade[0] = letterGrade[3]. Then on later iterations you're expecting letterGrade[0] to still somehow be 'A'...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List