AP Computer Science A Syllabus Prerequisites Students must have already taken the Introduction to Computer Science course and received a B+ or higher in order to be permitted to enroll in this course. Course Overview Having already taken the Introduction course, students know about data representation and basic programming structures in Scratch and JavaScript. This course introduces students to the Java programming language, the object oriented paradigm and the structure of larger and more complex systems. The Karel J Robot text and related activities will provide students with a foundation in the object oriented mindset for solving problems. There will be a minimum of 20 hours of instructional time spent on labs involving weekly hands-on in-class activities including the Elevens lab. The course will utilize pair programming and peer reviews to encourage reflection and emphasize the importance of writing understandable code. Skills that will be emphasized throughout the course include: problem solving, algorithm development, efficiency analysis, testing, debugging, commenting, and creating maintainable code. Texts • Bergin, Joseph. Karel J Robot: A Gentle Introduction to the Art of Object-oriented Programming in Java. S.l.: Dream Songs, 2005. • Litvin, Maria. Be Prepared for the AP Computer Science Exam in Java. Andover, MA: Skylight, 2014. Unit 1: Objects Topics to be covered • Creating and using objects • Inheritance • Methods • Polymorphism • Instance variables • Encapsulation Objectives • Instantiate UrRobot objects and use method calls to accomplish specific challenges • Create robot classes with additional methods to extend the functionality of the UrRobot class • Override methods in the UrRobot class to provide different functionality AP Computer Science A Syllabus • Add instance variables (with accessor and mutator methods) to the UrRobot subclass to track robot state Activities / Labs • Karel J Robot programs ◦ H-bot: efficiently arrange beepers a particular way ◦ Harvester, DiamondHarvester, StairClimber, StairSweeper, SquareBot: inherit from base class and add methods to extend functionality ◦ MileMover, TwoPileHBot, LongStairClimber, LongStairSweeper: override methods in parent class, use polymorphism to change behaviors without code repetition ◦ CrazyPolyBot: make sense of the method call resolution in a muddled polymorphic situation and adjust it to accomplish a task Unit 2: Flow control Topics to be covered • Boolean logic • Conditionals • Loops • Parameters • Return values • Recursion Objectives • Evaluate boolean expressions • Simplify boolean expressions • Create robots which can react to input about the world around them • Trace the flow of a program involving conditionals and loops and track the program state as it executes • Evaluate expressions that involve methods that return a value • Create a recursive solution for a given problem • Evaluate whether a recursive solution makes sense for a particular problem situation • Activities / Labs • Karel J Robot programs ◦ TwoBeeperFinder, BreadcrumbFollower, HoleyHarvester, BeeperFinder, HurdleRacer, BigHurdleRacer: use conditionals to create robots that respond to the world around them ◦ DrunkenWalker: simulate a probabalistic deviation from a path using loops and random numbers 1 AP Computer Science A Syllabus ◦ MultiplierBot, DecoderBot: use loops and the Java Math class to convert beepers representing a binary number into a base 10 number which represents an ASCII value ◦ InfiniteBeepers: use loops and conditions to solve a problem involving an infinite number of beepers to pick up ◦ DistanceToBeeper, PileCounter, ColumnCounter, CarpeterBot: use recursion to solve a robot challenge Unit 3: Interfaces Topics to be covered • Interfaces • Abstract classes • Polymorphism Objectives • Implement a given interface • Design abstract classes and interfaces and create subclasses that implement them • Predict the effect of calling a method on an object depending on its type and cast Activities / Labs • Karel J Robot challenges ◦ BeeperLayer, SpiralBot, BounceBot, PatternMover: analyze a robot program that uses interfaces and abstract classes to get a robot to switch movement strategies Unit 4: Collections Topics to be covered • 1D arrays • 2D arrays • ArrayList • List • Using polymorphism • Survey of other data structures Objectives • Modify, access, and traverse elements of an array or data structure • Understand efficiency consequences associated with using certain data structures 2 AP Computer Science A Syllabus Activities / Labs • Image inspection and manipulation: use getPixels to get a 1D array of all the pixels in an image and create a method to return a 2-dimensional array of Pixel objects • Create an ArrayList implementation and use it along with the Java String class methods to analyze an English lexicon and specific works of literature • Demonstrate how to use the java.util version of ArrayList and re-implement programs with it • Comparison of space and run-times using different data structures Unit 5: Class relationships and hierarchy design Topics to be covered • Composition vs inheritance • Implementation techniques • Testing • GUIs Objectives • Understand different relationships between objects • Design a hierarchy of classes with different relationships in a larger context • Review and practice other topics already covered Activities / Labs • Elevens lab Unit 6: Searching and Sorting Topics to be covered • Sequential search • Binary search • Selection sort • Insertion sort • Merge sort Objectives • Devise and implement own search and sort algorithms • Understand and be able to trace execution of the code for the reference implementation of the standard search and sort algorithms given a data set and compare efficiency for different scenarios. 3 AP Computer Science A Syllabus Activities / Labs • Discuss strategies for finding words in a dictionary by hand and writing a program to do it • Discuss strategies for sorting a deck of cards and applying this to the Elevens lab Unit 7: Review Topics to be covered • Review of all topics as needed Objectives • Identify and rectify holes in the students understanding of key concepts • Ensure students are familiar with the types of questions on the AP Exam • Practice problems to review material and increase confidence Activities / Labs • Practice problems and exam tips from Litvin (2014) • Practice exams Unit 8: Ethical and Social issues Topics to be covered • Intellectual property • Responsibility for errors and omissions • Software licensing options • Overview of software engineering Objectives • Understand the importance of intellectual property but how and why some people / corporations relinquish some of their property rights by making their source code available under different licenses • Understand the ramifications of and legal responsibility for malicious or badly written code • Know about software engineering practices which attempt to mitigate some of the risk of poor programming practice and facilitate coordination amongst members of a team Activities / Labs • Paper or presentation arguing for or against on of the positions related to computer ethics that were presented in class 4