Summer Assignment 2023#

Overview#

Hello and welcome to AP Computer Science! I’m very excited that you’ve signed up for the class! In APCS you will continue to improve your coding skills, learn how to think about code on a deeper level, and enhance your ability to create things on your computer.

In AP Computer Science we study object-oriented programming (OOP) in detail using the Java programming language. Java is part of the C family of programming languages (C++, Objective C, C#), and the syntax and concepts are very similar to C/C++. The Processing language is a simplified version of Java, with a focus on computer graphics programming. Processing is an excellent first language for learning the basic syntax and concepts underlying Java. In AP Computer Science we won’t use Processing directly, but we will use the Processing software libraries to write graphics programs in Java.

Resources for the Processing language#

The Processing language is open-source, and the Processing Development Environment is freely available for download:
https://processing.org/

Processing Examples that we have used in Computer Programming I/II at Marlborough:
https://dkessner.github.io/ProcessingExamples

There are also lots of tutorials and online documentation on this site. You can also find examples of Processing programs on this website:
http://openprocessing.org

Learning Processing by Daniel Shiffman is a very readable (but non-free) book on the Processing language. http://learningprocessing.com

Prerequisites#

You should be familiar with the following concepts before starting AP Computer Science:

  • variables

  • functions

  • conditionals (if)

  • loops (for, while)

  • classes and objects

These concepts are covered in Chapters 1-8 of Learning Processing. You don’t need to be an expert in using classes and objects (Chapter 8). However, you should be able to recognize a class declaration and understand how to use objects in a program. The summer assignment is meant to keep your skills sharp, to refresh your memory about Processing/Java syntax, and to start or continue thinking about classes and objects.

Note: You may have taken an introductory computer programming class in a language other than Processing (e.g. C++, C#, Python). In this case, you should spend some extra time to familiarize yourself with the Processing language. The best way to do this is to read Chapters 1-8 of Learning Processing, and to write some example programs as you go through the chapters. If you have studied a C-based language, the Processing syntax will be immediately familiar to you, and you should be able to do this reading in about a week (if you’re coming from Python, the ideas will be familiar, but the syntax will look a little different). After reading Chapters 1-8 and writing a few simple programs in the Processing Development Environment, you’ll be ready for the summer assignment.

Another note: The first five tutorials (“Text Tutorials”, through “Objects”) on the Processing website also give a good introduction: https://processing.org/tutorials/

Demo programs#

hello_objects.pde
a demo program that illustrates how to declare a class and how to create and use objects of that class (right-click to download file)

hello_objects_arraylist.pde
a demo program that illustrates the use of ArrayList, which allows you to create lots of objects without using a separate variable for each one (this part is optional – see assignment below)

You also may want to refer to these examples from our Computer Programming classes (especially the Classes 1, 2, 3 examples):
https://dkessner.github.io/ProcessingExamples

Summer assignment#

Your assignment is to write a program in Processing. The program must be an animation with setup() and draw() functions (i.e. not just a drawing). The program must also declare a class and use objects of that class. Other than these two requirements, you have complete freedom to create what you want. You will be showing your program to the class during the first week in the Fall.

Your program could be as simple as the hello_objects demo, or it can be as intricate as you like – be creative! However, you should not be copy/pasting code from anywhere. As you do this assignment, please keep in mind the goals of the exercise:

  • Practice declaring variables, and writing conditionals, loops, and functions.

  • Practice debugging code.

  • Practice thinking about classes and objects.

Optional (but highly recommended): For an additional challenge, use an ArrayList to store lots of objects (for example dozens or hundreds of bouncing balls or asteroids or bugs…).

If you have any questions as you are working on your program, feel free to email me. Have fun!