Home AP Computer Science Computer Science Principles FOOP Functional and Object-Oriented Programming Programming for Mobile Devices
Current Schedule Favorites Class(room) Policy Blog Gunn Girls Tech Club Send Me Email

Functional and Object-Oriented Programming


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

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

Notes on the list abstraction

Textbook: Simply Scheme, 2nd Edition by Brian Harvey and Matthew Wright.

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/15--8/19 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.

8/22--8/26 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/29--9/2 Words and Sentences Chapter 5 5.1, 5.3, 5.9, 5.12, 5.13, 5.15, 5.16, 5.19, 5.21

Vocabulary Worth Knowing, Abstraction Edition

9/6--9/9 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/12--9/16 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.

Rock Paper Scissors Lizard Spock Project

Rock Paper Scissors Lizard Spock Schoology version

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

9/19--9/23 Higher-Order Functions Chapter 8

HOF summary

Rock Paper Scissors Lizard Spock Project

Rock Paper Scissors Lizard Spock Schoology version

Jeopardy review game

Chapters 1--7 Test: FRIDAY 9/23

Solutions to valid-date? and describe-time problems

8.1, 8.3, 8.6, 8.7

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/26--9/30 Lambda

Chapter 9

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

9.1, 9.2, 9.3, 9.4, 9.5

10/3--10/6 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

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/10--10/14 Bridge Project Chapter 9 (Bridge Project)

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.17

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

10/17--10/21 Homecoming Week Special TBD TBD
10/24--10/28 Introduction to Recursion Chapter 11

Chapters 8 and 9 Test: FRIDAY, 10/28

Chapters 8/9 review thing

2012 Midterm 2

2012 Midterm 2 solutions

Solutions for chapters 8/9 review thing

11.1, 11.2, 11.3, 11.5, 11.6, 11.7

10/31--11/4 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

The Not Leap Of Faith Stuff

Extra Credit: 12.12* (this is really the most interesting problem in the chapter, so it is worth extra credit)

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

11/7--11/10 How Recursion Works; Common Patterns in Recursive Procedures Chapters 13 and 14

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/14--11/18

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/21--11/22

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/28--12/2

Abstraction and Lists

Chapter 17

Notes on the list abstraction

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

Solution to the toBinary problem (15.1)

17.1, 17.2, 17.3, 17.8--17.12, 17.14

Not-really-a-quiz on list functions

Notes on the list abstraction

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)

12/5--12/9

Abstraction and Lists

Chapter 17

Notes on the list abstraction

17.1, 17.2, 17.3, 17.8--17.12, 17.14

Not-really-a-quiz on list functions

Jeopardy Review

2012 Midterm 3

2012 Midterm 3 solution

*NEW* More review problems

Chapters 11--15 and 17 Test: WEDNESDAY, 12/7 (the test will cover recursion and lists; DO NOT USE HIGHER-ORDER FUNCTIONS ON THIS TEST UNLESS EXPLICITLY TOLD TO DO SO IN A PROBLEM STATEMENT; MAKE SURE TO READ PROBLEM STATEMENTS TO DETERMINE WHETHER YOU ARE DOING A LIST, SENTENCE, OR WORD PROBLEM)

Notes on the list abstraction

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

EXTRA CREDIT

Trees

Extra credit: Mastermind

Extra credit: Vectors

Chapter 18

Chapter 20

Chapter 23

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/12--12/16 Finals Week FINAL EXAM

Jeopardy Review Game

FINAL EXAM (Optional)

12/19--12/23

SLEEP

MORE SLEEP

EVEN MOAR SLEEP!!!*@#&(1/!!
12/26--12/30 IMPORTANT MUSIC RESEARCH
1/3--1/6 Introduction/Get Started

Chapter 1

Download and install Eclipse

Download and install Processing

R1.4, R1.5, R1.6, R1.10, PE1.1

Make a cow!

1/9--1/13 Using Objects Chapter 2

The distance problem

R2.1, R2.2, R2.3, R2.8, R2.9, R2.10, PE2.4, PP2.2

Field trip to Google and CHM on Friday, January 13; Meet at Batcave by 8:15am--DO NOT BE LATE!

1/17--1/20 Implementing Classes Chapter 3

Week 2 notes

An explanation of the BankAccount problem; includes both Main and BankAccount classes (Note: the BankAccount class will be in place by end of day, Wednesday, January 23.)

A sample bank account class

R3.1, R3.3, R3.6, PE3.1, PE3.12

1/23--1/27

Fundamental Data Types

Make sure to read Random Fact 4.2, pp. 133--135

Also read Quality Tip 4.1 on page 115. It is really, really important in the programming world.

Also make sure to read about the Scanner class, starting on p. 135

Chapter 4

Not-A-Quizzes are used to give you a sense of how you might do on a test question. If you are doing well with Not-A-Quiz problems, you are probably in great shape for a test! If you are confused, then you might want to ask more questions in class, come to Tutorial/Flex, etc.

VERY EXCITING NOT-A-QUIZ

Data types lecture notes

CH: R4.3, R4.4 (use a byte), R4.6, R4.8, R4.11, R4.16 (predict first, then test to check your answers), PE 4.3, PE4.8, PE4.12, PE 4.13

Solution to PE 4.3 (Don't look until you have given this an honest effort.)

Solution to the VERY EXCITING NOT-A-QUIZ

1/30--2/3 Graphics Chapter 5

String demo from lecture

Practice problems with Strings

Test 1 review problems

It might seem like we are getting ahead of ourselves as this is problem 6.18, but it makes for great review material for the test.

Some practice with the String class at javabat.com

PE5.6, PE5.8, PE5.14

Practice test

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

Solution to Bullseye problem (PE5.6)

2/6--2/10

Decisions (aka Conditionals)

Read Advanced Topics 6.1, 6.2, and 6.5 on pp. 195, 205, and 218

Chapter 6

Midterm 1 on chapters 1--4: Friday, February 10

R6.1, R6.5, R6.6, R6.8, R6.10, R6.13, PE6.1, PE6.4 (use a Scanner object), PE6.18;

2/13--2/15 Iteration Chapter 7

Squiral Starter Kit 2

CH: R7.2, R7.4, R7.5, R7.6, PE7.9, PE7.11, PE7.12

2/21--2/24 Iteration Chapter 7

CH: R7.2, R7.4, R7.5, R7.6, PE7.9, PE7.11, PE7.12

Squarifier (while loop example)

Guess my number game solution (don't look until you've tried to solve it yourself!)

2/27--3/3 Iteration Chapter 7

CH: R7.2, R7.4, R7.5, R7.6, PE7.9, PE7.11, PE7.12

Squiral starter kit

Solution to problem 7.11

Solution to problem 7.12

Solution to squiral problem (PE7.9)

Finish Chapter 7 homework

3/6--3/10 Arrays and ArrayLists Chapter 8

The Fibonacci array problem

The dice histogram problem

Introductory arrays practice

Magic square quiz (challenge problem)

R8.8, R8.9, R8.11, R8.12, P8.18 (READ NOTES), PP8.2 (Conway's Game of Life; this is the most important project for the year)

3/13--3/17 The Big Project: Conway's Game of Life

NOTE: Conway's Game of Life will be done in Processing, not conventional Java. The code given for this project is a bit out of date and Processing will make it a cleaner project. Update soon!

The Big Project: Conway's Game of Life

R8.8, R8.9, R8.11, R8.12, P8.18 (READ NOTES), PP8.2 (Conway's Game of Life; this is the most important project for the year)

PRACTICE TEST

PRACTICE TEST SOLUTIONS

Jeopardy review for Midterm 2

3/20--3/24 The Big Project: Conway's Game of Life The Big Project: Conway's Game of Life Midterm 2 on chapters 6 and 7: Friday, March 24

Array review problems

Solution to the magic square problem

Continue Conway's Game of Life;

3/27--3/31 SPRING BREAK SPRING BREAK Power Loafing
4/3--4/7 The Big Project: Conway's Game of Life The Big Project: Conway's Game of Life

Continue Conway's Game of Life

4/10--4/14 The Big Project: Conway's Game of Life The Big Project: Conway's Game of Life

Continue Conway's Game of Life

ArrayList practice

ArrayList practice solutions

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

4/17--4/21 The Big Project: Conway's Game of Life The Big Project: Conway's Game of Life

The most excellent Bell Number Problem.

Solution to Bell Number Problem

The Josephus problems

Solution to the Josephus problem

Continue Conway's Game of Life

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

4/24--4/28 The Big Project: Conway's Game of Life The Big Project: Conway's Game of Life

The swap and reverse problems

Solution to swap and reverse

Solution to swap and reverse for ArrayLists of type Integer

2013 Midterm 3

2013 Midterm 3 solutions

Midterm 3 practice problems

Midterm 3 practice problem solutions

FINISH Conway's Game of Life;

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

5/1--5/5 Interfaces and Polymorphism Chapter 11

Lecture/demo notes

Midterm 3 Monday, May 5 (covers chapters 1--8, but not Graphics stuff)

Write a method that takes an array of type Object and prints its contents.

Go to http://java.sun.com and look up the documentation for the Comparable interface.

PE11.10 (Use the coin class on pp. 793--794; yes, it is later in the book, but it is stuff you already have seen. Promise!)

Sorting problems

Coin class and Comparable interface example from class

5/8--5/12

Inheritance

Interfaces and Polymorphism

Chapter 11

Lecture/demo notes

The Point and Polygon problems

Write a method that takes an array of type Object and prints its contents.

Go to http://java.sun.com and look up the documentation for the Comparable interface.

PE11.10 (Use the coin class on pp. 793--794; yes, it is later in the book, but it is stuff you already have seen. Promise!)

Sorting problems

Coin class and Comparable interface example from class

5/15--5/19 Recursion

Chapter 18

JEOPARDY REVIEW THING

R18.1, R18.6, PE18.1; Write two methods that find the Fibonacci numbers, one using a loop, the other using recursion. The Fibonacci numbers are 1, 1, 2, 3, 5, 8, 13, 21, 34, etc.

JEOPARDY REVIEW THING

A practice problem for the final.

5/22--5/26 TBD

TBD

TBD

5/29--6/1 Finals

THE FINAL EXAM (Chapters 1--8 and 11; everything up through ArrayLists plus Interfaces/Polymorphism)

A Period: Wednesday, 5/28, 8:30am
C Period: Wednesday, 5/28, 10:32am
F Period: Thursday, 5/29, 10:32am

Have a great summer!

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/22, 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.