Section 8.3

Coding Task #1

Learning Goals


AAP-1.D.7: The exam reference sheet provides the notation [value1, value2, value3, …] to create a list with those values as the first, second, third, and so on items. For example, 

●   aList ← [value1, value2, value3,...] creates a new list that contains the values value1, value2, value3, and … at indices 1, 2, 3, and … respectively and assigns it to aList. 

●   aList ß [] creates a new empty list and assigns it to aList. 

●   aList ß bList assigns a copy of the list bList to the list aList. For example, if bList contains [20, 40, 60], then aList will also contain [20, 40, 60] after the assignment. 

AAP-1.D.8: The exam reference sheet describes a list structure whose index values are 1 through the number of elements in the list, inclusive. For all list operations, if a list index is less than 1 or greater than the length of the list, an error message is produced and the program will terminate. 

AAP-2.N.2: List procedures are implemented in accordance with the syntax rules of the programming language. 


Objectives and Description

The objective of this lesson is to provide students with exposure to the agnostic coding language used in the AP CSP exam through a coding task. Additionally, this task is meant to prepare students for the first sprint of their ARC Challenge.

Activities

Activity 8.3.1 (55 minutes)