AP Computer Science Summative Labs

I have selected the summative labs for next year’s AP Computer Science course. Students complete a huge number of practice programming activities as a whole class, through pair programming, or on their own. The purpose of these practice activities is to focus on learning and receive and provide feedback. At the end of each unit, students complete a summative lab. I kept the most successful labs from last year pretty much unchanged, revised some, and incorporated some new ones. An important element of each summative lab are the extensions. None of the extensions are required, but most students try to implement some of them or create their own extension. I have students with a diverse set of programming experience and knowledge, and the extensions provide the opportunity for each student to be challenged.

A new element of next year’s class, which affects all the labs, is the use of GitHub. I want students to be exposed to and gain familiarity with some of the best practices of software engineering. Last year, students leveraged JUnit to write unit tests. This year, they will use GitHub for source control management. I created a repository for each unit which contains some practice projects and at least an empty project for the summative lab (maybe more, depending on the lab). Students will fork these repositories into their own accounts and commit changes as they work on the practice programming activities and summative lab throughout the unit. When they complete the summative lab, they will create a pull request. In response, I will offer feedback and assess their summative lab. At the end of the course, students will have a collection of repositories in their own GitHub account that captures all of their coding.

Here are the summative labs with links to the associated unit’s GitHub repository:

Turtle Lab

This is a new summative lab. I’m de-emphasizing (but not eliminating) GridWorld. The first lab used to involve placing GridWorld actors in a world. Instead, students will do something similar with turtles. This lab leverages the Media Computation classes from Georgia Tech. This lab nicely frames the first unit as students create a turtle world program on their very first day of class.

Purpose

The goal of this lab for you to experience what your first assignment as a software developer at a software company may be like. You will be working with a large body of code (Turtle and TurtleWorld) with which you are unfamiliar. You don’t understand all of the intricacies of the existing code base and you aren’t yet familiar with many of the Java language features that you will use. However, through experimentation and browsing the documentation, you will be able to complete this assignment and most likely go beyond the requirements!

Requirements

  • Sync the TurtleLab directory from GitHub.
  • Draw a pattern using at least two Turtle objects.
  • Invoke multiple methods on the turtle objects to change their attributes.
  • Follow our Java style guidelines.

Extensions

  • Make a more sophisticated pattern.
  • Make a pattern that involves multiple colors.
  • Change the picture for the turtle to something else.
  • Add more awesome.
  • Something else? Be creative and share!

Submission

  • Submit a pull request in GitHub and submit a link to the request with this assignment.

Cityscape Lab

This lab was new last year and was created by my counterpart at our sister high school. I’ve left it as is other than incorporating the design class diagram into the lab description. (I drew the DCD on the whiteboard last year in response to student questions.)

Introduction

The goal of this lab is for you to demonstrate that you can define classes, create objects, and display graphics via a Java application.

Requirements

  • Create a Java graphical application (with a Viewer class, Component class) that displays a cityscape.
  • Design at least three classes for elements of the cityscape (e.g., building, window, sun, moon, car, tree)
    • demonstrate good class design (encapsulation)
    • provide configurability through constructors and instance variables (size, color, etc.)
  • Create multiple instances of a class with different properties and display in the cityscape.
  • Document the class using JavaDoc comments as demonstrated in our code template.
  • Peer review another student’s lab and provide comments in the rubric hosted in Canvas.

Here is a design class diagram to illustrate the relationship among the classes in this project:

CityscapeDCD

Extensions

  • Define additional classes for additional elements of the cityscape.
  • Animate your cityscape (e.g., day and night, lights in windows, moving cars)
  • Randomize your cityscape (a different cityscape every time)
  • Add more awesome.

Submission

  • Submit a pull request in GitHub and submit a link to the request with this assignment.

Game of Life Lab

This was the first lab that I created on my own and have used it the past two years. It is a perennial favorite of the students. Last year, I tried to incorporate unit testing into this lab and it was a bit rocky. This year, I’m providing more scaffolding to help students implement their unit tests.

Introduction

The goal of this lab is to apply your understanding of decision and loop structures to implement a complex algorithm within the context of an unfamiliar and significant software framework (GridWorld). In addition, you will implement a unit test for your program using the JUnit framework and create documentation for your program using JavaDoc.

Requirements

Write a program that plays Conway’s Game of Life. Conway’s Game of Life is a cellular automaton. From Wikipedia:

The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

  • Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.
  • Any live cell with two or three live neighbours lives on to the next generation.
  • Any live cell with more than three live neighbours dies, as if by overcrowding.
  • Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
  • The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed—births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick (in other words, each generation is a pure function of the preceding one). The rules continue to be applied repeatedly to create further generations.

Nonfunctional Requirements:

  • the program must be implemented in Java and utilize the GridWorld platform
  • I recommend not use GridWorld’s execution engine to produce subsequent generations. It will be easier to implement the unit test if you directly produce and display subsequent generations.

Artifacts to Produce:

  • Requirements Document: Many functional and nonfunctional requirements needs to be defined. You must define additional requirements that are reasonable and document them in a requirements document. I must review your requirements document before you start the design document or test plan. You may change the requirements document throughout development.
  • Design Document: You must do some design activity before starting implementation. This may consist of a flow cart, pseudocode, or other design artifact. I must review your design document before you start implementing code. You may change your design document throughout development.
  • Test Plan: You must create a test plan with specific test cases (at least two) before starting implementation. I must review your test plan before you start implementing your test class. You may change your test plan throughout development. The provided code in GitHub is an example of implementing an initial test case.
  • GameOfLifeTestTest Class: JUnit-compatible test class that implements the test plan.
  • GameOfLife class: You must produce a working class the meets the requirements and is verified and validated by your test plan.
  • Reflection Document: This is a significant and challenging lab. Please reflect on this experience and share your feedback with me. What did you like or dislike and why? What was surprising or unexpected? What did you learn? What questions do you still have? What advice would you offer next year’s students?

Extensions:

  • Add custom icons for alive or dead cells.
  • Implement more sophisticated seed patterns.
  • Add more awesome.

Submission:

  • Ensure the following artifacts have been committed to GitHub in addition to your code:
    • requirements document
    • design document (pseudocode, flow charts, etc.)
    • test plan (with specific test cases)
    • HTML documentation generated by JavaDoc
    • reflection document
  • Submit a pull request in GitHub and submit a link to the request with this assignment.

Rubric:

The implementation will be evaluated according to the Computer Science Grading Rubric in Canvas. The other artifacts will be evaluated independently.

Signals in Noise Lab

This is a new lab. It is inspired by the post “Detecting Signals and Noise” on the DataGenetics blog. I was looking for a new lab for arrays and array lists. I also wanted a lab that more directly represented an authentic application of computer science. This technique to detect a signal in the presence of noise is conceptually very similar to that used in particle physics experiments (e.g., dark matter candidates hitting multiple CCD pixels or tracks reconstructed within a particle collider). I wrote the code for the case of a stationary target as an example. Students will tackle the more challenging case of a moving target. I’m really looking forward to seeing how students engage with this lab.

Introduction

The goal of this lab is to apply your understanding of 2D arrays to implement a complex algorithm. In addition, you will implement a unit test for your program using the JUnit framework and create documentation for your program using JavaDoc.

One common application of computing is signal analysis. In real-world applications, the data that is processed is a combination of something of interest (the signal) and garbage that obscures the signal (noise). Computational techniques for signal analysis are prevalent in a wide variety of scientific and financial applications. This lab provides a simplified context in which to explore signal analysis. Conceptually, the techniques you will use in this lab are similar to those used in particle physics experiments.

Requirements

  • Write a Monster Early Warning program that finds a moving monster based on the data from your noisy radar system. This is described in DataGenetics blog post, “Detecting Signals in Noise.” The sample code in GitHub implements the case of a stationary monster. You may leverage this code to implement the case of a moving monster, which is more complicated.
  • Design your program such that the initial position and velocity (dx and dy) of the monster can be specified interactively (e.g., from a user) or as parameters (e.g., for your unit test).
  • Implement a unit test for your program that tests multiple cases.
  • Document your code with standard JavaDoc comments.

Extensions:

  • Add support for detecting multiple monsters.
  • Develop a different detection algorithm.
  • Add support for straight-line constant acceleration motion.
  • Add more awesome.

Submission:

  • Submit a pull request in GitHub and submit a link to the request with this assignment.

Collage Lab

This lab is from the Media Computation materials from Georgia Tech. Students create incredibly creative collages. This is the first lab of the spring semester and is a good review of the fall semester after winter break. This lab is very similar to the new AP Picture Lab. I’m going to have students complete most of the activities in the AP Picture Lab as practice programming activities.

Introduction

The goal of this lab is for you to apply creatively the filters and transformations that you have developed throughout this unit.

Requirements

  • collage contains at least 4 copies of the image
  • the 4 copies includes the original image and at least 3 modifications of the original image
  • modifications must include one or more filters (changing colors) and one or more transformations (scaling, cropping, mirroring)
  • the collage must run on its own (don’t invoke FileChooser.pickAFile())
    • instead copy the source image file into the same folder as your Java source files and just specify the file name to the Picture constructor
    • For example: Picture sourcePic = new Picture(“beach.jpg”);
  • the collage must be saved as an image file, the path needs to be absolute and specific to where you have your bookClasses folder stored. I recommend copying and pasting the path from an Explorer window to your code and then escaping the backslashes. For example:
    • finalPic.write(“H:\2014\AP Computer Science\Media Computation\bookClasses\MyCollage.jpg”);

Extensions

  • Add more copies.
  • Add more filters
    • sepia:
      • convert to grayscale
      • if red < 60 then reduce all three components to 90% of their original value
      • else if red < 190 then reduce just blue to 80% of its original value
      • else reduce just blue to 90% of its original value
    • posterize
      • set all color component values in a range to one value (the midpoint of the range)
      • try with four ranges for each color (0-63, 64-127, 128-191, 192-255)
    • pixelate
  • Add more transformations (e.g., rotation)
  • Add more awesome.

Submission

  • Commit the generated collage image file to GitHub.
  • Submit a pull request in GitHub and submit a link to the request with this assignment.

Elevens Lab

This is one of the new AP Computer Science labs. I wanted to try a new object-oriented design lab and this looks like it may be a good fit.

Introduction

The goal of this lab is for you to apply object-oriented design principles to implement the card game Elevens.

Requirements

  • complete Activities 1-9 of the AP Elevens Lab.
  • peer review another student’s lab and provide comments in Canvas.

Extensions

  • complete Activities 10-11 of the AP Elevens Lab.
  • Add more awesome.

Submission

  • Submit a pull request in GitHub and submit a link to the request with this assignment.

Fractal Tree Lab

The original version of this lab was inspired by George Peck from Lynbrook High School. The end product of this lab has remained the same over the past two years, but last year it was more effective since I provided much less scaffolding. That change was a result of feedback from students who let me know that the original version of the lab was too easy. I’m keeping it unchanged for next year.

Introduction

The goal of this lab is to create a recursive algorithm to draw a tree.

Imagine you were describing how to draw a tree. You might say:

  1. Draw a vertical line
  2. At the top of the line, draw two smaller lines (“branches”) in a v shape
  3. At the ends of each of those two branches, draw two even smaller branches
  4. Keep repeating the process, drawing smaller and smaller branches until the branches are too small to draw

This process of repeating the same design at a continually decreasing scale is an example of a Fractal. Using fractals to draw trees can give some interesting and beautiful patterns. In this assignment we will use a recursive branching function to create a fractal tree.

Requirements

  • Use the Koch Snowflake program as a starting point for an TreeViewer class and a TreeComponent class.
  • The trunk of the tree needs four values: the X and Y of the starting point and the X and Y of the end point. We will also have three member variables that will control:
    • how much smaller the branches are
    • how small the branches will get
    • the angle between the branches.

Extensions:

  • Add controls (e.g., scrollbars) to allow the user to change member variables that affect the construction of the tree.
  • Some fantastic trees can be produced by modify algorithm to add asymmetry, adjust angles,
 adjust thickness, or adjust color.
  • Add more awesome.

Submission:

  • Submit a pull request in GitHub and submit a link to the request with this assignment.

Leave a Reply