Arrays/Lists and and index values

Please pardon if this is a question I should know the answer to but I’m a little confused. In Lesson 13, of Unit 5 we learn about numbering arrays, starts with 0 and goes then to 1,2,3,4…

In the reference materials in the college board materials, it states:
Text:
list[i] refers to the element of list at index i. The first element of list is at index 1.
Clarify please?

You’re not confused. It’s confusing.

Most programming languages (by far) use zero-based indexing for arrays. The College Board pseudocode for some reason decided to use 1-based indexing. (The only popular language that I know of that uses 1-based indexing is Scratch.)

This is important to note for your students, but the exam itself shouldn’t ask questions that are gotchas in terms of the indexing. Not much consolation, I know. But this is the world we live in.

Baker

P.S. You’ve doubtless noted a number of other curiosities about the College Board pseudocode that students will have to contend with as well. This is by design to some degree. Since the course allows you to program in any language the pseudocode for the test should equally (dis)advantage everyone.

2 Likes