Arlington Tech

Arlington Tech

AP Computer Science Principles


Overview

This week we will complete Chapter 4 - Names for Strings and begin Chapter 5 - Names for Turtles.

Thursday, October 6th

Today we will make sure you have version of Python and the libraries you need to run the example programs from our text on your school laptop.

NOTE: The grade distribution for this week:

  • A: 16
  • B: 0
  • C: 4
  • D: 0
  • E: 4

indicates that 16 of us completed both assignments on time, 4 of us completed 1 of the 2 assignments, and 4 of us did not submit either. I will make phone calls home tomorrow to those finding it challenging to complete assignments.

Classwork

Let's start with a few questions:

  1. How are procedures abstract in computer science?
    1. They are blocks of code that do something specific.
    2. They represent the lowest level of code for the computer to run.
    3. They use actual values to represent concepts.
    4. They can be used without understanding or seeing the code used.
  2. What do parameters used in a procedure provide?
    1. They allow software reuse for different values.
    2. They return calculated values from the procedure to the calling program.
    3. They provide a way to call a procedure from within another procedure.
    4. They provide the connection of an API to the procedure.
  3. You are writing a program to help the school assign lockers each year. You have a list of student names and a separate list of locker numbers. The locker numbers match the index position for the list. Assume the lists are correctly initialized. What can replace <missing code> to assign the student to the next available locker?
      students ← [list of student names]
      lockerNum ← [list of locker numbers]
      index ← 1
      FOR EACH name in students
      {
          <missing code>
          index ← index + 1
      }
    
    1. lockerNum ← name
    2. lockerNum[index] ← name
    3. students ← lockerNum
    4. students[index] ← lockerNum

We will introduce the term API, and discuss how we use APIs in programming to hide implementation details in our programs. If time permits, we can take a look at student_lockers.py.

Homework

If you have not already done so, install Python 3.10 from the App Catalog. Then run:

    % pip3.10 install pillow --user

Then read Chapter 5 - Names for Turtles up to the section Bob Builds a House, trying the examples and completing the code puzzles as you read.

Add a program named [your name]s_house.py to your git repo that has turtle with your name build a house with a chiminey and a door.

This assignment is due on Sunday at 1 pm.

Monday, October 3rd

We will begin class today by sharing what we found in the investigation we did for homework. After that, we'll begin learning about strings.

Classwork

Our goals for class today include:

  1. Briefly review Markdown and talk about how to use it in your git repos.
  2. Introduce APCSP Pseudocode and describe how you will use it in this course.
  3. Read through Chapter 4 - Names for Strings together in class, answering any questions you have about strings and the operations on them. I will also share some additional Python string features not presented in the text.

Homework

Create a directory named Chap04 in your git repository. Complete each of the 22 exercises from Chapter 4 Exercises in a separate file in this directory, naming each file by its number, for example, the first one should be named q01.py.

Feel free to use the f-strings I showed you in class instead of the clunkier syntax used in the text.

This assignment is due on Wednesday at 1 pm.

Shout Outs

Shout outs to Gabriel, Alex, Jake (talk about Markdown), Blu, Noah (talk about Markdown), Emory (nice Markdown!), Evan (amazing Markdown!), and Kiersten for providing us with an examplary study plans.