Computer Science - Norcross High School

advertisement
Norcross High School
5300 Spalding Drive
Norcross, GA 30092
Phone: 770-448-3674
Fax: 770-447-2644
Revised: February 5, 2014
®
AP Computer Science Syllabus
Course Overview
®
AP Computer Science is both a college-prep course for potential computer science majors and a
foundation course for students planning to study in other technical fields such as engineering, physics,
chemistry, and geology. The course emphasizes programming methodology, procedural abstraction, and
in-depth study of algorithms, data structures, and data abstractions, as well as a detailed examination of
a large case study program. Instruction includes preparation for the AP Computer Science Exam.
Students should leave class with a clear understanding of Java and the ability to adapt to any new
programming language that they are taught in college. Some programming concepts will be introduced
through use of a game development environment called Greenfoot and robotic software called Finch.
Computer Facilities
The Computer Lab is arranged in one continuous row of 18 computer stations around the perimeter of the
room and two vertical rows of five computers each. A teacher’s computer station is located in the middle
of the room from which the teacher can use the LCD projector. There is a one-to-one ratio of machines to
students, and some areas set up for discussion of the topics outside of the lecture. Our Lab and the Labs
around campus are managed and maintained by a full-time technical support staff. Students can work
during Guided Study, after school, and at home.
Texts
Brown, Beth. A guide to programming in Java 5. Lawrenceville Press, 2005.
Horstmann, Cay. Java Concepts 4th Edition, 2005, John Wiley and Sons.
Trees, Frances P., Java Concepts Study Guide, 4th edition, 2006, John Wiley & Sons.
A+ Computer Science Lessons
Cook, Charles, Blue Pelican Java
http://www.bluepelicanjava.com
Grading Weights:
Tests
45%
Daily/Quizzes 35%
Finals
20% (Performance Exam & Final M/C exam)
Other Resources
Institute of Computer Technology: JAVA CURRICULUM FOR ADVANCED PLACEMENT™ COMPUTER SCIENCE.
http://www.ict.org/, 2006
1
GridWorld Case Study. The College Board, 2007.
Topics at a Glance
General Topic
Week
Greenfoot
1-4
Java Basics
5-7
Looping : for and while loops
8-9
GridWorld Part 1
10
GridWorld Part 2
11 - 12
Classes and Interfaces
13 - 15
Arrays and ArrayList
16 - 18
Quadratic Sorts and Linear/Binary Search 19 - 21
Mergesort, Recursion
22
GridWorld Parts 3 and 4
23 - 26
Inheritance and Abstract Classes
27 - 28
Review
29 - 33
2
Weeks 1 – 4
This unit serves as an introduction to the principal concepts in computer science using the Greenfoot
game development environment. Consider Greenfoot as a combination between a framework for creating
two-dimensional grid assignments in Java and an integrated development environment (class browser,
editor, compiler, execution, etc.) suitable for novice programmers. While Greenfoot supports the full Java
language, it is especially useful for programming exercises that have a visual element. In Greenfoot
object visualization and object interaction are the key elements. Alice is animation software that teaches
fundamentals of Java programming.
Objectives
















Understand computer terminology: Single-user system, WAN, LAN, Network, CPU, Processor,
Peripherals
Set up network account
Identify parts of a computer: CPU, ALU, Secondary Memory, Peripherals
Review school Acceptable Use Policy
Discuss social and ethical ramifications of computer use and computer programming
Understand object-oriented programming and top-down design/refinement of individual tasks
Basic class structure including instance variables, local variables, parameter passing, scope,
public/private visibility, use of super
Declaring a class, methods, parameters
Sequence, selection, and iteration
Recursion
Inheritance and polymorphism, overriding methods
Use Math.random
Analyze, design, code, and test software
Syntax error detection and correction
Runtime error detection and correction
Teaching Strategies
Alice and Greenfoot are effective, open-source software packages to introduce the concept of inheritance
while teaching the majority of aspects of a programming language. Students intuitively discover and use
conditional statements to create new types of functionality for the existing game classes, as well as
extending the existing classes in creating custom versions of their own games.
References/Readings
Alice Tutorial, http://www.alice.org
Greenfoot Tutorial, http://www.greenfoot.org
Blue Pelican Java, selected readings from Chapters 1 – 6, 14, 15
Java Concepts, selected readings from Chapters 1, 4, 7 – 9
Read “Ethical Problems with Modern Technology” by Eric Douglas Nielsen, Michigan State University
Assessments






Create a MyWombat class that extends the Wombat class adding the following functionality to the
Wombat class: spin, spinBack, jumpTwo, jumpThree, moveBackward, and at least one custom
method of your choosing.
Create even more specific Wombats that extend the MyWombat class (FastWombat,
SlowWombat, DizzyWombat). Use looping and recursion when appropriate
Create a DancingWombat – use Math.random()
Write an essay on a programmer’s ethical responsibility to society
Quizzes over syntax, debugging, writing methods
Unit Test over concepts taught in this unit
3
Weeks 5 – 7
This unit introduces the basics of the Java language.
Objectives
•
•
•

•
•
•
•
•



Source, bytecode, compilers, interpreters, Java virtual machine, platform independence
Computer software and hardware components, operating systems
Binary, Octal, Hexadecimal Number Systems
Primitive and class data types, declaring variables and constants
Assignment statements
Arithmetic operators and precedence, limits on int and double types
java.lang.Math class static methods(abs, pow, sqrt, random, min, max)
String class, object references, aliasing
Boolean Algebra
Selection (if, if/else, nested if/else)
Output using System.out.print and System.out.println
Input using java.util.Scanner methods
Teaching Strategies



Use Hands-On Computer Science activity to introduce Binary Number System
Small programs are used during lecture to highlight the programming concepts being covered.
Students are assigned a variety of small programs to practice the concepts taught in this unit.
References/Readings




Blue Pelican Java, selected readings from Chapters 8 - 12
Java Concepts, selected readings from Chapters 4 and 6
Computer Science Unplugged, Count the Dots
ICT: assorted labs and worksheets
Assessments



Programming assignments include: swapping two values, calculating slope of a line, guess the
computer’s random number, graphics programs: smiley face, house, robot
Quizzes over assignment statements, Boolean Algebra and selection
Unit Test over concepts taught in this unit
4
Weeks 8 – 9
This unit focuses on looping: for, while, and recursion.
Objectives









Understand iteration
Understand recursion
Understand three parts of a looping construct: initialization, test, update
Use appropriate looping construct for a given problem
Understand base case and recursive method calls
Design solutions for problems that require repetition
Compare running times of different algorithms to solve a common problem
Calculate the exact number of times a statement executes in a loop
Test boundary conditions when using loops
Teaching Strategies


Small programs are used during lecture to highlight the programming concepts being covered.
Jeliot –Algorithm Animation Theatre – used to visually demonstrate how loops and recursion
works: http://cs.joensuu.fi/~jeliot/
Students are assigned a variety of small programs to practice the concepts taught in this unit.

References/Readings



Blue Pelican Java, Chapters 9 – 12, 40
Java Concepts, Chapters 7, 18
ICT: assorted labs and worksheets
Assessments



Programming assignments include: Summing, approximating square root, producing
multiplication tables, finding all combinations of coins that add up to a dollar, Pythagorean triples
from 3 to 100
Quizzes over for loops, while loops, nested loops, and recursion
Unit Test over concepts taught in this unit
5
Week 10
GridWorld Case Study Chapter 1: Observing and Experimenting with GridWorld
Objectives







Download and install the case study files
Use Dr. Java to create a workspace and separate projects for the case study classes
Set the classpath for each project to include the case study jar file
Run the First Project file: BugRunner
Learn how to use the GridWorld GUI
Observe how a Bug object acts in the grid
Use the drop-down menus to call methods for bugs, rocks, flowers, and the grid
Teaching Strategies
The GridWorld GUI is an interactive GUI. Students can observe the actors’ behaviors, test actors’
methods, and learn how actors act when they are placed in the grid by right clicking on each object in the
grid and running methods. This unit is designed to let students explore and discover what functionality
the actors possess and how the actors behave in the grid.
References/Readings
GridWorld Case Study, Chapter 1
Assessments



Do You Know? Set 1 Exercises, pg 6 narrative
Exercises, pg 8 narrative
Quizzes over Chapter 1 of GridWorld
6
Weeks 11 - 12
GridWorld Case Study Part 2: Bug Variations
Objectives













Read and understand a problem description, purpose and goals
Use simple inheritance to create new Bug types by overriding the act method
Apply data abstraction and encapsulation
Read and understand class specifications and relationships among the classes
Add new methods, where appropriate, for the act method to call
Identify reusable components from Bug class
Write preconditions and postconditions for new methods
Use debugging techniques to find and correct errors in code
Understand and modify BoxBug class to create new Bug classes
Understand and modify BoxBugRunner class to create new runner classes
Identify boundary conditions when moving a bug
Test boundary conditions when moving a bug
Understand when runtime exceptions are generated when moving a bug
Teaching Strategies
Chapter 2 of the case study is teaching simple inheritance. In many ways, it is like the Fang Engine
environment. The code for the Bug class constructors and the act method is the only code that the
students need to really understand at this point. Students need to only use the canMove, turn and move
methods. In such a constrained space, students can focus on creating a subclass of the Bug class by
modifying the BoxBug class. Students will learn to test boundary conditions for moving a bug by calling
the Bug class canMove method. Preconditions and postconditions can be written for new methods, where
appropriate.
References/Readings
GridWorld Case Study, Chapter 2
Assessments




Do You Know? Set 2 Exercises, pg 11 narrative
Programming Exercises, pg 12-14 narrative
Quizzes over Chapter 2 of GridWorld
Unit Test over Chapters 1 and 2 of GridWorld
7
Weeks 13 - 15
Classes and Interfaces
Objectives


Read and understand a problem description, purpose and goals
Understand class vocabulary: constructor, accessor, modifier, behaviors, attributes, private/public,
instance variables, class constants
Design and implement a class
Choose appropriate data representation and algorithms for a class
Apply data abstraction and encapsulation
Apply functional decomposition
Read and understand class specifications and relationships among the classes
Implement a given interface
Write preconditions and postconditions for class methods
Create advanced data structures and algorithms. Topics include 1-D and 2-D arrays, ArrayLists,
sorting algorithms (Insertion Sort, Selection Sort, and Merge Sort) and recursion.








Teaching Strategies
Games and cartoons are used to help students understand creating a class that models an object.
Current popular games and cartoons are used to model the relationship between a class and an instance
of the class. The students will also be given many small examples of classes to complete.
Interfaces can be very challenging, and the game/cartoon examples can be very useful in making it more
relevant. For example, there are "mortal" and "immortal" games objects (people vs. rocks), and methods
regarding living are a great connection to a "Mortal" interface.
References/Readings
ICT: assorted labs and worksheets,
Java Concepts, selected readings from Chapter 11
Assessments




Labs to create a Dice class, Monster class, Circle class, Pet class
Lab to create a Coin object that implements the Comparable interface
Quizzes over class vocabulary, completing a class
Unit Test over concepts taught in this unit
8
Weeks 16 - 18
Arrays, ArrayList, String and Wrapper Classes
Objectives













Read and understand the AP subset API for the ArrayList, String, Integer and Double class
Use the generic version of the ArrayList
Declare and instantiate an array and ArrayList
Add values to an array and ArrayList
Traverse a String, array and ArrayList
Insert and delete values in an array and ArrayList
Set an existing value in an array or ArrayList to a new value
Use an array and/or ArrayList as a private instance field of a class where appropriate
Use the length, substring and indexOf methods of the String class to solve problems
Apply data abstraction and encapsulation
Use loops to traverse an arrays and strings: for loop, while loop, enhanced for loop (arrays only)
Discover and code standard algorithms for an array( Example:find large, find small)
Determine which type of loop is the appropriate loop for traversing and processing an array or
ArrayList
Teaching Strategies
Business applications are used to help students visualize a one-dimensional array and operations on the
one-dimensional array.
References/Readings
Java Concepts, selected readings from Chapter 7, 8
ICT: assorted labs and worksheets
Assessments




Beginning array and ArrayList labs to create, instantiate, populate and process values in the onedimensional arrays
Use an array as a frequency vector
Quizzes over array and ArrayList basics and traversals and processing of arrays and ArrayLists
Unit Test over concepts taught in this unit
9
Weeks 19 - 21
Sorts and Searches
Objectives






Discover and code the algorithm for a linear search in an array/ArrayList
Discover and code the algorithm for the binary search
Compare and contrast the linear search and the binary search
Understand and code the algorithm for the Selection Sort
Understand and code the algorithm for the Insertion Sort
Compare and contrast the Selection Sort and Insertion Sort algorithms
References/Readings
ICT: assorted labs and worksheets
Java Concepts, selected readings from Chapter 17
Assessments



Labs to code the sorts and compare times
Quizzes over searches and sorts
Unit Test over concepts taught in this unit
10
Week 22
MergeSort
Objectives



Discover and code the algorithm for a merging two sorted lists
Discover and code the algorithm for the recursive merge sort
Compare and contrast the merge sort and the quadratic sorts
Teaching Strategies
Decks of playing cards and Number tiles are used as a physical model of a one-dimensional array.
Students use these hands-on “arrays” to help them understand how to demonstrate the MergeSort
concept.
References/Readings
ICT: assorted labs and worksheets
Java Concepts, selected readings from Chapter 17
Assessments



Labs to code the sorts and compare times
Student Phonebook database program: add merge sort to this lab
Quizzes over all sorts
11
Weeks 23 - 26
GridWorld Case Study Chapters 3 and 4:
GridWorld Classes and Interfaces
Interacting Objects
Objectives












Read and understand a problem description, purpose and goals
Read and understand class specifications and relationships among the classes
Read and understand the API’s for the Actor and Location classes and the Grid interface
Read and understand code for Bug, Critter and Chameleon Critter classes
Extend the Critter class to create new subclasses
Identify reusable components from Critter class
Write preconditions and postconditions for new methods
Use debugging techniques to find and correct errors in code
Understand and modify CritterRunner class to create new runner classes
Identify boundary conditions when moving actors in a bounded grid
Test boundary conditions when moving actors in a bounded grid
Understand when runtime exceptions are generated when moving an actor
Teaching Strategies
Chapter 3 of the case study focuses on understanding the APIs for the Location and Actor classes and the
Grid interface. It is very important that students study the APIs and learn how to correctly use the
methods for objects of these classes. Each actor in this case study has a location and a grid reference.
An actor uses its location to navigate its grid and to find other actors in its grid. A Location object
encapsulates the coordinates of the actor’s position in its grid and also contains direction constants and
methods that determine the relationship between locations and directions. In this section of the case
study, worksheets specifically designed to help students understand how to use the methods of the Actor
and Location classes and the Grid interface are used.
Chapter 4 of the case study introduces the Critter class. In this class, the act method calls five methods:
getActors, processActors, getMoveLocations, selectMoveLocation, and makeMove. Students should override
these methods when creating a new Critter subclass. The act method will rarely be overridden for Critter
subclasses.
References/Readings
GridWorld Case Study, Chapters 3 and 4
Assessments







Actor, Grid, and Location worksheets
Do You Know? Set 3, pg 18 narrative
Do You Know? Set 4, pg 20 narrative
Do You Know? Set 5, pg 22 narrative
Do You Know? Set 6, pg 24 narrative
Quizzes over Chapters 3 and 4 of GridWorld
Unit Test over Chapters 3 and 4 of GridWorld
12
Weeks 27 - 28
Inheritance and Abstract Classes
Objectives


Read and understand a problem description, purpose and goals
Understand class vocabulary: constructor, accessor, modifier, behaviors, attributes, private/public,
instance variables, class constants
Design and code an abstract class
Choose appropriate data representation and algorithms for a class
Apply data abstraction and encapsulation
Apply functional decomposition
Read and understand class specifications and relationships among the classes
Create a nonabstract class that extends an abstract class
Write preconditions and postconditions for class methods







Teaching Strategies
Pet Parade, Ticket Design, and Vehicle Design free response questions are used to help teach all of the
concepts associated with extending an abstract class.
References/Readings
ICT: assorted labs and worksheets
Java Concepts, selected readings from Chapter 13
2004, 2005, and 2006 Computer Science A Exam Design Free Response Questions
Assessments



2004, 2005, and 2006 CS A Exam Design Free Response Questions
Quizzes over class vocabulary, extending an abstract class, inheritance, casting
Unit Test over concepts taught in this unit
13
Weeks 29 - 33
Review for AP CS A Exam
Objectives

Prepare students for the AP CS A Exam
Teaching Strategies
At this time of year I guide reviews with the students during class for their final exam and AP CS A
Exam.
References/Readings
ICT: assorted labs and worksheets and study guides
Prior Years’ Computer Science A Exam Free Response Questions
Prior Years’ Computer Science A Exam Multiple Choice
Barron’s AP Computer Science A Test Preparation Book
Assessments


Short multiple choice question quizzes over AP CS topics
Free Response questions from old exams and review books
14
Download