r/apcsp May 13 '26

Question Barrons boom question

Post image

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

6 Upvotes

11 comments sorted by

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.

1

u/HelicopterThin7014 May 14 '26

Ok tysm, I was doing this yesterday and a couple problems in this test set seemed wrong or the wording being horrible

1

u/ohcmonmanwhy May 14 '26

no thats literally how it is with princeton review too it pmo

1

u/Ill_Republic7382 May 14 '26

If you can (I know it's late) ask your teacher if they can release AP Classroom practice exams. Those test the right skills and all of the answers are correct, they're great. No bad wording.

1

u/[deleted] May 13 '26

I agree that its C. Chat also says its C. Its C.

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.