AP Computer Science Crash Course

by Jimmy Newland

AP/IB Computer Science Bellaire HS

Computer Science is software engineering

Computer science is more akin to engineering than it is to math or science. Teaching computer science means learning engineering skills. Most students haven’t had an experience like learning computer science. The mix of creativity, math skills, trial & error, frustration and the compounding nature of the programming skills is a hard thing to get used to. AP computer science students can handle mastering the topic with no previous experience with computer science. Many schools opt to make AP computer science the second course to involve programming and not the first. In fact a first year of computer science or programming is often a prerequisite for taking AP computer science.

One thing of note here is that AP computer science teaches object-oriented programming using a subset of the Java programming language designed by Sun Microsystems which is now a subsidiary of Oracle Corporation.

Learner-centered Assessment Example: What is a computer?

Write a sentence or two for each of these questions:

What is a computer? What makes something a computer?

What is software and what makes something software?

What is the Internet and are the world wide wed and the Internet the same thing?

AP Course Description for Comp Sci

The AP course description (sometimes called the acorn book) supplied by College Board is the official curriculum an AP teacher is expected to cover. The course audit process tries to insure that instructors use an approved & appropriate syllabus. Details are few in the book but stuff in here must be covered. Besides sample multiple-choice and free-response questions and some generic College Board stuff the Java subset can be found in the acorn book for comp sci. Teachers need to know what to teach and what can be safely ignored.

Tested in A exam

Potentially relevant to CS1/CS2 course but not tested on the A exam

int, double, boolean Integer.MAX_VALUE, Integer.MIN_VALUE

short, long, byte, char, float

+ , -, *, /, %, ++, --

Using the values of ++, -- expressions in other expressions

=, +=, -=, *=, /=, %=

 

==, !=, <, <=, >, >=

 

&&, ||, ! and short-circuit evaluation        

<<, >>, >>>, &, ~, |, ^, ?:

(int), (double)

Other numeric casts such as (char) or (float)

String concatenation

StringBuffer

Escape sequences \", \\, \n inside strings

Other escape sequences (\', \t, \unnnn)

System.out.print, System.out.println

Scanner, System.in, Stream input/output, GUI input/output, parsing input, formatted output

 

public static void main(String[] args)

1-dimensional arrays

2-dimensional rectangular arrays;

Arrays with 3 or more dimensions, ragged arrays

if, if/else, while, for, enhanced for, return

do/while, switch, break, continue

Modify existing classes, design classes

 

public classes, private instance variables, public or private methods or constants

protected or package visibility

@param, @return

javadoc

static class variables        

final local variables, final parameters, final instance variables, final methods, final classes

static methods        

null, this, super, super.method(args)

this.var,

this.method(args),

this(args)

Constructors and initialization of static variables

Default initialization of instance variables, initialization blocks

Understand inheritance hierarchies. Design and implement subclasses. Modify subclass implementations and implementations of interfaces.

 

Understand the concepts of abstract classes and interfaces.

Understand equals, ==, and != comparison of objects

String.compareTo

clone, implementation of equals, generic        Comparable<T>

Conversion to supertypes and (Subtype) casts

instanceof

 

Nested classes,inner classes

Package concept, import packageName.ClassName;

import packageName*, static import, defining packages, class path

Exception concept, common exceptions

Throwing standard unchecked exceptions. Checked exceptions try/catch/finally, throws

String, Math, Object, List, ArrayList

Sorting methods in Arrays and Collections

Wrapper classes (Integer, Double)

autoboxing

There is some attention paid to issues related to object-oriented design and testing the design process. The computing philosophy of AP comp sci is something you need to know. The best way to get a handle on this is to look at the topic outline. There are lots of ways to teach comp sci and College Board has chosen some specific stuff. Read the book and know the stuff in there and have the students do the same. There is also a more comprehensive document that includes everything mentioned here and more: AP Comp Sci Teacher’s Guide.

Scope & Sequence

        Bellaire HS Comp Sci Google Calendar is matched to district and school dates and shared publicly.

Pacing Guide for Java Software Solutions 1st ed.

(40 Week School Year) – these days/weeks include assessments

Note: Time has been left to cover the AP Case Study either as a separate chapter or within each chapter.

Topic

Chapter

Weeks (flexible)

Computer Systems

1

1.4

Test – Computer Systems

1

.2

Intro to objects and using them

2 (2.0 – 2.2)

.4

Variables/Data Types and Arithmetic

2 (2.3 – 2.6, 2.9)

1

Using Object Variables

2.7, 2.8, 2.10, 2.11

.8

Review/test

2

.4

Boolean Expressions/if Statements

3.0 – 3.4

1

Assessment

3.0 – 3.4 (decision structures)

.2

Looping Structures

3.5 – 3.9

2

Assessment

3.5 – 3.9 (looping structures)

.2

Writing Methods in classes

4.0 – 4.2

1

Advanced Methods

4.3 – 4.5

1

Assessment

4

.2

Advanced Objects: References, Static Exceptions

5.0 – 5.1

1

Extension: Designing classes

5.4

.2

GUI and Dialog Boxes

5.7, 5.8

.6

Assessment

5

.2

Intro To Arrays (indexing, objects, simple algorithms)

6.1, 6.2 (linear search)

1

Searching/Sorting

6.2, 6.3, 6.4

1

Enrichment:Hashing

6.5

.2

Assessment

6.0 – 6.5

.4

Enrichment:Two Dimensional Arrays

6.6

.6

ArrayList

6.7

.4

Polygons/buttons

6.9, 6.10

.4

Assessment

6

.2

Subclasses – reading documentation, looking at a simple subclass

7.0

.6

Overriding Methods, Hierarchies

7.1, 7.2

.4

Using class members

7.3

.4

Polymorphism/Inheritance

7.4, 7.5

1

GUI’s and Mouse Events

7.7, 7.8

.6

Assessment

7

.2

Recursive Thinking

8.0

.4

Recursion in Programming

8.1, 8.2

.6

Recursive Sorting

8.3

.6

Graphics

8.5

.6

Assessment

8

.2

Enrichment – Data Structures

Total: 24

HISD & the HAPG

The HISD curriculum department in conjunction with the educational technology group has been working since August of 2009 on a horizontal alignment and planning guide for computer science. Some of the material will work well with the AP curriculum and some won’t. As of early August 2010 the HAPG still isn’t integrated into CLEAR Online which is only available to HISD employees by logging into the HISD portal.

HISD HAPG for Comp Sci (August 2010)

Java Software Solutions

The textbook adopted by the district for AP computer science was also one approved by the state for the same purpose and is also an approved book by College Board. There is a newer edition of the book and often the slides, notes, and labs for the newer edition can simply replace the material for the older book. There are places where the instructor must make changes and make sure the students know the lecture material supersedes the text. The textbook adoption process in Texas makes switching to a newer text quite difficult. If your campus is able you can purchase textbooks that are up-to-date but the cost is often prohibitive. The publisher has a lot of material available for instructors via PHSchool.com. Be careful not to share the material or the web code with others so students can’t get access to teacher resources!

There are a variety of curricula available for purchase that are up-to-date and less expensive than a whole set of textbooks. The instructor is responsible for making the material available to the students.


Teaching in a Computer Lab

Having computers in a classroom environment is both a boon and a bane for the teacher. Computers act as the ultimate distraction. The first rule in a computer lab is just like the first rule in any class - classroom management is the key to a successful class. Students should know when it is and isn’t ok to use the computers. Then the goal is to have the student use the computer for classroom stuff ONLY.

Email is something my students need to access but I tell them that the computers aren’t for their personal use so read email judiciously. I can read over their shoulder if I choose. The computer lab is a public environment and students should remember they are responsible for their own data always.

The other main issue is that when non-classroom stuff goes on with the computers the hardware invariably becomes bogged down with malware of sorts. The more time the teacher spends maintaining the computers the less time the teacher can spend on all the other things that need doing.

Creating a sensible printing policy is also a good idea. When and how can students print and how much? Computer that need maintenance beyond what the teacher can handle should be coordinated through the campus IT person or the HISD helpdesk if there is no on-campus IT staff. You will need the HISD tag #, the make and model, and a very clear and detailed description of the issue to get anything fixed.

Teaching Programming

One challenge for AP computer science is offering adequate time creating software, completing lab programming assignments and actually doing software engineering. My rule of thumb is for every 10 days of class that 4 of those are dedicated to programming. This doesn’t have to mean traditional programming labs. You can give assignments that are meant to only occupy a few minutes or the entire period or multiple days. There may also be programming projects that take a week or more to complete.

There isn’t one set way to evaluate a program and not all assignments are created equal. Using a rubric to evaluate all the labs is not usually realistic. But simply assignment completion grades for labs means students aren’t really learning what they are doing wrong and learning how to fix it. Things will vary from one assignment to the next.

One assessment tool is the programming test where one or a pair are given an period to complete a programming task. This can be multi-part or have some kind of tiered grading scale. Either way it provides some hands-on assessment of the programming process for the teacher to evaluate. See the assessment section for more information about programming tests.

One idea that has grown from the “extreme programming” movement is pair-programming. Two people work on programming tasks as a unit. One person doesn’t dominate the keyboard and both are meant to take an active part in the development process. Recent research in this area from the likes of UC Santa Barbara and others suggests that female students often feel that pair-programming makes computer science more interesting and often less threatening. Others suggest what happens is one person gets away without doing any work. No solutions works for everyone.

The subject of academic honesty or cheating always follows from a discussion of pair-programming. Computer science is a subject already using the technology that makes sharing ideas and information ubiquitous. Ignoring code plagiarism is done at the teacher’s peril but using draconian techniques to prevent academic dishonesty can create more trouble than it prevents. There are a lot of options from software solutions to interviews but at some point copying code needs to be something the teachers addresses head on. This will probably be an ongoing effort for most of us.

When it comes to computer science homework teachers ideas are very diverse. One constant issue is availability. Do students have access to the lab outside of class time? Can and will students work from home on lab assignments? Choosing an integrated development environment (IDE) for lab and home use means deciding on operating system and price point. Java has a wide set of IDE choices for Windows, Mac OS X, and Linux. Most of the options offer free versions of the software or are always free.

Integrated Development Environments for AP Comp Sci

These are all free and work with both Windows and Mac OS X. Most also have a Linux version also.

Java has a free built-in and comprehensive documentation system. The Java API is the official documentation for the language. Students should learn to use the Java API or JavaDocs but this will probably take some time. For many students the API has too much information and it takes experience to learn what is useful and what is not. Java classes should all follow the JavaDoc standard for documentation and the GridWorld case study comes with a separate API.

Assessing Comp Sci Students

Assessment in computer science like quizzes, tests, free-response questions, multiple-choice questions, think-pair-share assessment and project based learning (for me this is the IB dossier but a programming  project will work) are the same as most other subjects. The AP computer science exam is tests whether or not students have mastered the equivalent of a undergraduate course in comp sci. The assessment in the course should mirror the exam. This means multiple choice and free response assessments at least once a grading cycle. But quizzes and classroom activities that are student-centered and learner-driven can help students navigate the tough material in more authentic way.

Think-pair-share activities are a great way to directly involve students in their learning. Questions might be delivered to the whole class and a pair of students work for a minute or two on each question. Then that pair shares with another pair to verify everyone is getting the process down. Then after a few minutes the teacher can asses the students using white-boards, hand gestures, electronic response systems (clickers), or by calling on pairs and having them answer or report. The questions can be about algorithms, OOP, a programming topic or computers in society. The format can be short answer, a program, or multiple-choice.

One technique teachers employ to assess student learning is through the programming test. These can be intimidating to students. Pair-programming is a great way to alleviate some of that fear. Having questions at staggered difficulty levels also helps. Generally in a 50 minute class students will have time to complete only one question from a programming test so allowing them to attempt the level they are competent to complete means that some problems are worth more points than others. Handling the inevitable all-or-nothing nature of these problems means that at least one should be a lifeline that can be completed quickly and without too much effort.

GridWorld Case Study

The AP computer science curriculum includes a multi-part case study called GridWorld designed to be used with the normal chapter material or to be a stand-alone project after the textbook material is complete. Either way students testing in AP computer science will need to be very familiar with the case study and its components. It is expected that students will have programmed from the case study code base. There is a student manual students are expected to read and work from. There is also a publicly available solutions manual which students will almost certainly discover on their own.

The projects in the student narrative are the absolute least amount of work recommended. Probably instructors should supplement with more labs and assignments. The intention of the case study is to replace the need for a large scale culminating programming project and to test knowledge of object-oriented design methodology. The GridWorld curriculum module for teachers is a great resource for lesson plans and projects in comp sci.

There are 4 major sections to the case study. The first is almost trivial and can lull students into thinking the whole thing will be easy. The last section contains a large amount of information and students will need time to master the wide variety of circumstances that come up. The AP computer science exam will cover the case study in 2 ways: 5 of the 40 multiple choice questions will cover aspects of the GridWorld case study and 1 of the 4 free-response questions will cover GridWorld.

More GridWorld material

GridWorld Part I Questions & Exercises Practice

The AP Comp Sci Exam

The AP computer science exam is a two part paper and pencil (and pen) test meant to determine whether or not a student is fluent in introductory undergraduate computer science topics including programming in object-oriented Java. The two parts are a 40 question multiple-choice section that must be completed in 1 hour and 15 minutes and a 4 question free-response section that must be completed in 1 hour and 45 minutes. There is no computer component of the exam - all coding must be done on paper. Students are expected to know a variety of standard algorithms for topics such as searching and sorting as well object-oriented coding and design paradigms. The AP computer science teacher isn’t allowed to take part in the AP computer science exam administration. Scores are released in July.

Students are given some code references and some of the code from the GridWorld case study to use on both portions of the exam. The document is called the AP Comp Sci A Quick Reference. It is a good idea to use this as a tool in class all year long so students are familiar with the contents and use of the quick reference.

Grade distributions for AP Computer Science A

In the 2009 administration, 16,622 students took the exam. The mean score was a 3.04. The grade distribution for 2009 was:

Score                Percent

5                     23.2%

4                     25.7%

3                     13.2%

2                     8.2%

1                     29.8%

AP computer science exams are graded in the summer by a team of trained graders mainly consisting of AP computer science teachers along with some college professors and consultants. Anyone can qualify to participate although you must have been teaching the subject for 3 years to apply to grade. Graders do receive an honorarium and paid-travel to and from the grading site.

The scoring guidelines are available for all free-response questions for the last few years. Students should practice using these guidelines so they are familiar with what graders are looking for. The code doesn’t have to compile and can contain some small errors with losing points. Some things do lose points and some more than others. College Board does provide a simple set of exam tips for AP comp sci.

All questions have the same value regardless of difficulty and questions are not necessarily placed in order of difficulty. There is a penalty for guessing but eliminating even one option on a multiple-choice question means the likelihood of getting the answer right is better than just a guess. Clean and neat code is preferable to wordy, sloppy, or unnecessary code on the free-response section.

Having students complete a mock exam lets them know exactly what they are in for and gives them real-world experience with the testing format. There is a practice exam available to teachers that completed the AP course audit and variety of prep books available to draw exam prep material from for classroom use.