Quote:
|
I have a question, Val. In the current code, won't pairs that are both even or both odd get added to ep while pairs that that are one even and one odd be added to op? Is it supposed to be tallied this way?
|
YOU ARE RIGHT! I MADE A MISTAKE.
The program does what it should do but I explained it wrong!!!! OMG.
We want to know the amount of EVEN or ODD
PRODUCT pairs.
So basically:
ep = even(Numbers[i] * Numbers[j])
op = odd(Numbers[i] * Numbers[j])
Thanks for pointing out this huge flaw in the postcondition. However the code remains correct. I have updated it in my original post.
Well done!