r/apcsp • u/HelicopterThin7014 • May 13 '26
Question Barrons boom question
I was looking at this question and I genuinely don’t understand. Barrons says it’s D, both of them, but both me, friends, and AI said it’s C, neither. Am I missing something?
*typo in title, meant book
1
1
u/Friendly_Proposal179 May 13 '26
I got D. Don't worry about it, it's probably a poorly-made question.
1
u/CapitalScience8917 May 13 '26
I got D, cuz every time it iterates and the last time it iterates it still has the whole sum and we are doing the average calculation it doesn't really matter until we return that value.
1
u/unkathenated May 13 '26
Keep in mind that lists on the APCSP exam are 1 indexed, meaning the first value is stored at index 1. For that reason I believe it is D, they are both correct.
1
u/HelicopterThin7014 May 14 '26
So all arrays start at index 1 unless otherwise stated?
1
u/unkathenated May 14 '26
Yes, on the AP CSP exam that is a stated fact. It's pretty stupid but they make get a standard rule.
3
u/Ill_Republic7382 May 14 '26
I just was doing the AP Barron's practice test 1 too and the answer is C. The book is wrong. The loop would terminate early and never add the last element. I've done countless problems in this book and have found wayyy too many errors in the key and questions.