Home AP Computer Science A FOOP Capstone Summer Homework for AP CS A AP Computer Science Principles
Current Schedule Favorites Class(room) Policy Blog Gunn Girls Tech Club Send Me Email

Functional and Object-Oriented Programming


Paley Office Hours Zoom Room


Randal Munroe answers the essential baseball question

xkcd explains functional programming (make sure to put the mouse over the cartoon)

Program hygiene

If you are looking for some Java practice, it's hard to argue with Advent of Code

This is what you need to do to set up a computer for this course. (Installation instructions for DrRacket)

Stuff you need to know for the final

Textbooks: Simply Scheme, 2nd Edition by Brian Harvey and Matthew Wright; CS Awesome (Runestone)

Fine Print: The schedule below is inaccurate. Mr Paley is not teaching this class this year. What is fairly accurate is the homework list although there are some modest changes. Consult your teacher for the details.

WEEK TOPIC(S) READING
HOMEWORK
8/11--8/13 Showing Off Scheme; Functions Chapters 1 and 2

Install DrRacket; 1.1*, 1.2*, 2.1, 2.2, 2.3, 2.4, 2.7 (note that the answer to 2.7 contains more than just basic arithmetic functions)

Save your work someplace safe. We will be uploading work to Schoology next Monday.

* OK, we're not really doing this problem.

Download this folder of Scheme files and put it in your Racket folder (Mac: /Applications/Racket, PC: C:\Program Files\Racket)

To load a file from the scheme folder into DrRacket (in this example, functions.scm), use:

Mac: (load "/Applications/Racket/scheme/functions.scm")
PC: (load "C:\\Program Files\\Racket\\scheme\\functions.scm")

8/16--8/20 Composition of Functions; Defining Your Own Functions Chapters 3 and 4

Finish 2.1, 2.2, 2.3, 2.4, 2.7 (note that the answer to 2.7 contains more than just basic arithmetic functions)

3.1 (do the plumbing diagrams by hand, not on the computer), 3.5, 3.6, 3.7, 3.9, 4.1, 4.3, 4.4, 4.5, 4.8 (including the hotshots stuff), 4.10

Notes on problem 4.8

Vocabulary Worth Knowing

8/23--8/27 Words and Sentences Chapter 5 5.1, 5.2, 5.3, 5.4, 5.9, 5.12, 5.13, 5.15, 5.16, 5.19, 5.21

Vocabulary Worth Knowing, Abstraction Edition

8/30--9/3

Boolean Values (True and False), Variables

Chapters 6 and 7

CAPTCHA video

Please make sure to read "Predicates" on pages 72--74, "Decisions, Decisions, Decisions" on pages 78--80 and "Let" on pages 94--97.

Chapter 5 Not-Really-A-quiz

6.1, 6.3, 6.4, 6.7, 6.8, 6.11, 6.14, 7.1--7.4

An honestly useful and amusing video for problem 6.11 (h/t Rajeev Virmani)

Problem 6.11 starter kit

Notes on problem 6.14

Notes on problem 7.1

9/7--9/11 Boolean Values (True and False), Variables

Chapters 6 and 7

CAPTCHA video

Please make sure to read "Predicates" on pages 72--74, "Decisions, Decisions, Decisions" on pages 78--80 and "Let" on pages 94--97.

Military hours warmup problem

An honestly useful and amusing video for problem 6.11 (h/t Rajeev Virmani)

Finish 6.1, 6.3, 6.4, 6.7, 6.8, 6.11, 6.14, 7.1--7.4

Problem 6.11 starter kit

Notes on problem 6.14

Notes on problem 7.1

Practice Test

Practice Test Solutions

9/13--9/17 Higher-Order Functions Chapter 8

HOF summary

Rock Paper Scissors Lizard Spock Project

Quiztestthing: Wednesday 9/15 on chapters 5 and 6

Practice Test

Practice Test Solutions

Solutions to valid-date? and describe-time problems

8.1, 8.3, 8.6, 8.7, 8.13, 8.14

Problem 8.6: Here is a listing of the military alphabet. Hint: making a helper function that takes a letter as its input and returns the appropriate military word might be helpful.

9/20--9/24 Higher-Order Functions Chapter 8

HOF summary

Rock Paper Scissors Lizard Spock Project

Quiztestthing: Friday, 9/24 through chapter 7 (let)

Solutions to valid-date? and describe-time problems

8.1, 8.3, 8.6, 8.7, 8.13, 8.14

Problem 8.6: Here is a listing of the military alphabet. Hint: making a helper function that takes a letter as its input and returns the appropriate military word might be helpful.

9/27--9/30 Lambda

Chapter 9

This is a chapter with subsections that are essential. Starting with The Truth About Let, also read Name Conflicts, Named and Unnamed Functions, and Pitfalls.

HOF summary

Where You At? survey

The Ones problem (hi)

9.1, 9.2, 9.3, 9.4, 9.5

10/4--10/8 Lambda

Chapter 9

This is a chapter with subsections that are essential. Starting with The Truth About Let, also read Name Conflicts, Named and Unnamed Functions, and Pitfalls.

Higher-Order Functions and Intro to Lambda not-really-a-quiz

HOF summary

Quiztestthing: Tuesday, 10/5 on Higher-Order Functions

Solutions for problem 9.4

9.8, 9.10, 9.14, 9.15, 9.17 (this is not a short assignment; if you get stuck, PLEASE come and see me for help)

Every and Lambda not-really-a-quiz

accumulate not-really-a-quiz

10/11--10/15

Bridge Project

Chapter 9 (Bridge Project)

HOF summary

Portfolio assignment on Schoology (Movie Friday, Creating folder for RPSLS and uploading both RPSLS and Bridge Hands projects into the folder) [See Schoology for details]

Bridge Project (all functions at the end of Chapter 9) (Be sure to use your time effectively in class.)

Bridge hand starter kit

Solution for problem 9.15

Solution for problem 9.17

Write a possible chapter 8/9/10 test problem.

10/18--10/22

Introduction to Recursion Chapter 11

Quiztestthing: Tuesday, 10/26 on Higher-Order Functions and Lambda (includes the bridge hand project)

Chapters 8/9 review thing

2012 Midterm 2

2012 Midterm 2 solutions

Solutions for chapters 8/9 review thing

10/25--10/29 Introduction to Recursion; Leap of Faith Chapters 11 and 12

11.1, 11.2, 11.3, 11.5, 11.6, 11.7, 12.2, 12.4, 12.5, 12.7, 12.12

Lecture notes for factorial

Lecture notes for problem 11.2 (count-ums)

The Not Leap Of Faith Stuff

Friday: Intro to Recursion not-really-a-quiz

11/1--11/5

How Recursion Works; Common Patterns in Recursive Procedures Chapters 13 and 14

Solution to Bridge Hands Project

13.3, 13.4, 13.6, 14.2, 14.6, 14.7, 14.9, 14.10, 14.15

Patterns examples and patterns problems

Patterns solutions

11/8--11/12

11/11 Veterans Day

How Recursion Works; Common Patterns in Recursive Procedures Chapters 13 and 14

November Survey

Solution to Bridge Hands Project

13.3, 13.4, 13.6, 14.2, 14.6, 14.7, 14.9, 14.10, 14.15

Patterns examples and patterns problems

Patterns solutions

11/15--11/19

Advanced Recursion

Extra Credit: Pattern Matching

Chapter 15

Decimal to binary conversion. Use the first method and note that the binary result is produced by putting the last remainder first and working upward.

15.1--15.4; it is OK to use accumulate one time in problem 15.2

Scoring Poker Hands Project

Here are some functions to help get you started on the Poker Hands Project

Here is a solution to the project.

Extra Credit: 16.2--5, 16.7, 16.9, 16.10, 16.15--16.21 (Chapter 16 stuff is time-consuming; there is a reason it is listed as extra credit and not part of the main homework)

11/22--11/26

Thanksgiving

THANK

GIVE

11/29--12/3

Poker Hands Project


Poker helper functions

Solutions to poker helper functions

Solutions to 14.7 (differences), 14.15 (merge), and 15.1 (toBinary)

Scoring Poker Hands Project

Here are some functions to help get you started on the Poker Hands Project

Poker hands chart

12/6--12/10

Abstraction and Lists

Trees

Extra credit: Mastermind

Extra credit: Vectors

Chapter 17

Notes on the list abstraction

Chapter 18

Chapter 20

Chapter 23

NOTE: HARD DEADLINE ON EXTRA CREDIT SUBMISSION IS FRIDAY, DECEMBER 11 AT 11:59PM.

DO NOT PROCRASTINATE AND DEFINITELY DO NOT HAND IN EXTRA CREDIT LATE!

17.2, 17.4, 17.8, 17.9, 17.10, 17.12, 17.14

Practice Problems with recursion

The All-Encompassing Review Problem

Jeopardy Review

2012 Midterm 3

2012 Midterm 3 solution

*NEW* More review problems

Use Friday to wrap up all core homework. If you have completed that, use Friday to do extra credit problems.

Notes on the list abstraction

18.1--4, 18.6 (If you do this, you are eligible for the extra credit possibilities, below)

Mastermind can be written for substantial extra credit (4 points). You will need some of the stuff in Chapter 20 as that is where user input is discussed. Mastermind game due on Sunday, December 11. No exceptions.

Extra credit: 23.2, 23.3, 23.14 (complete the abstraction by writing make-matrix, matrix-ref, matrix-size (should return a list of the number of rows and number of columns), and matrix-set!), 23.13, 23.12 (this order of problems is the order in which I would choose to do them).

Extra credit: Do the spreadsheet problems: 24.1, 24.2, 24.3, 25.1--25.12

12/13--12/17

Finals Week FINAL EXAM

Poker hands solution

The All-Encompassing Review Problem

The All-Encompassing Review Problem solution

Jeopardy Review Game

12/20--12/24

Winter Break

SLEEP

MORE SLEEP

EVEN MOAR SLEEP!!!*@#&(1/!!

12/27--12/31

Winter Break

IMPORTANT MUSIC

INSTALL JDK 8 FROM THE INSTALLATIONS FOLDER IN SCHOOLOGY. JDK should be VERSION 8. NOT VERSION 15. YOU MUST INSTALL JDK 8 BEFORE INSTALLING ECLIPSE.

Download and install Eclipse

Download and install Processing

1/5--1/7 Welcome Back  

INSTALL JDK 8 FROM THE INSTALLATIONS FOLDER IN SCHOOLOGY. JDK should be VERSION 8. NOT VERSION 15. YOU MUST INSTALL JDK 8 BEFORE INSTALLING ECLIPSE.

Download and install Eclipse

Download and install Processing

1/10--1/13

Primitive Data Types
Initialization and Assignment
Mathematical Operators

Runestone 1.3
Runestone 1.4
Runestone 1.5
Runestone 1.6

Enroll in the coding rooms classroom

Data types lecture notes

Runestone 1.3 (all problems)

Runestone 1.4 (all problems)

Runestone 1.5 (all problems)

Runestone 1.6 (all problems)

Make a cow!

1/18--1/21 Using Objects

Runestone Chapter 2

QTT: Runestone Chapter 1

The distance problem

Solution to the distance problem

Objects: Runestone 2.1 through 2.5 (all problems)

Strings: Runestone 2.6 and 2.7 (all problems)

The Math class: Runestone 2.9 (all problems)

Optional: Wrapper Integer and Double classes: Runestone 2.8

1/24--1/28 Using Objects Runestone Chapter 2

Objects: Runestone 2.1 through 2.5 (all problems)

Strings: Runestone 2.6 and 2.7 (all problems)

The Math class: Runestone 2.9 (all problems)

Optional: Wrapper Integer and Double classes: Runestone 2.8

1/31--2/4 Using Objects Runestone Chapter 2

An explanation of the BankAccount problem; includes both Main and BankAccount classes

QTT Day 3 on Classes/Objects (Turtle geometry)

2/7--2/11 Conditionals (if, else, else if, etc.)

Runestone Chapter 3

Runestone 3.1 through 3.7 (all problems except those that demand you use repl.it; repl.it is really great, but using it is an optional thing)

Practice problems with Strings

Some practice with the String class at codingbat.com

Practice test

Practice test solutions (Don't peek until you have tried the problems first!)

2/14--2/17

Loops (Iteration)

Chapter 4

Runestone 4.1 through 4.4

Pascal's Triangle

Do a squiral

QTT Day 2 on Conditionals and Strings

If you have finished the squiral, then look at the Nifties and find a CS1 or CS2 project to do for extra credit

2/22--2/25 Writing Classes Chapter 5

Loop warmup problems

Loop warmup problems solution

Runestone 4.1 through 4.4

Do a squiral

QTT Day 2 on Conditionals and Strings

If you have finished the squiral, then look at the Nifties and find a CS1 or CS2 project to do for extra credit

2/28--3/4

Writing Classes

Pong

Chapter 5

Pong

Do the Stars and More Stars problems.

Runestone 5.1--5.9 (NOTE: A lot of this will feel like review because we have created classes and used methods. 5.3 should be completely new.)

Write Pong. Here is a Pong starter kit.

3/7--3/10

Writing Classes

Pong

Chapter 5

Pong

Do the Stars and More Stars problems.

Runestone 5.1--5.9 (NOTE: A lot of this will feel like review because we have created classes and used methods. 5.3 should be completely new.)

Write Pong. Here is a Pong starter kit.

QTT Day 3 on Classes/Objects (review the Point class from the distance problem and the BankAccount class to prepare)

3/15--3/18 Arrays Chapter 6

Runestone 6.1--6.3

The Histogram Problem

3/21--3/25 Arrays Chapter 6

Runestone 6.1--6.3

The Histogram Problem

3/28--4/1

SPRING BREAK SPRING FORTH AND

BREAK

4/4--4/8

Spring Break
ArrayLists Runestone Chapter 7

Runestone Chapter 7.1, 7.2, 7.3, 7.8

The Josephus problems

One solution to the histogram problem

4/11--4/15 ArrayLists Runestone Chapter 7

QTT on Day 1 on arrays

Runestone Chapter 7.1, 7.2, 7.3, 7.8

The Josephus problems

4/18--4/22

Arrays (2-dimensional)

Runestone Chapter 8

QTT on Day 2 on arrays

Runestone Chapter 8.1, 8.2, 8.3

Conway's Game of Life

PP7.5 Magic square challenge problem

More array review problems

Solution to the array review problems

Solution to the magic square problem

Find a Nifty for extra credit if you have CGoL done.

The Test

4/25--4/29

Chessboard starter kit

Chessboard starter kit

Chessboard starter kit

Conway's Game of Life

5/2--5/6 Conway's Game of Life Conway's Game of Life

Conway's Game of Life

The primes problem

5/9--5/13

Inheritance and Delegation

Runestone Chapter 9

Runestone Chapter 9.1--9.8

Animals example from lecture

5/16--5/20 Inheritance and Delegation

Runestone Chapter 9

Runestone Chapter 9.1--9.8

Animal Farm project

5/23--5/27 Final Exam

THE FINAL EXAM (Chapters 1--9; everything through Inheritance and Delegation)

PRACTICE FOR FINAL!

Solutions to PRACTICE FOR FINAL!


Have a great summer!

5/31--6/2

Readings are due each Monday.  Homeworks and projects are due AT THE BEGINNING OF CLASS on the following Monday unless it is a holiday. In that case they are due the first class period after the holiday.

Chapters 3 and 4 should be read and the programming problems for chapters 1 and 2 should be done by Monday, 8/20, so we can move forward promptly. Problems are always due the first day of class that week. (If you are focused during class, this is unlikely to be a problem.)

Unexcused late homework, projects, quizzes, and tests will be given a score of zero.  If you expect to have problems meeting a deadline, I need to know about it in advance.  Excuses after the fact will be given zero tolerance, barring a note signed by parents.