Computer Science Program Summary of Computer Program: The Computer Science Program is primarily a two year program. The first year course is titled, Computer Science I (CS I). CS I would best be characterized as a Pre-AP Computer Science course. CS I has a goal of introducing students to computer programming using the JAVA programming language. CS I is organized in a way to facilitate a logical progression of computer science education for beginners. A threepronged approach is used: 1. Computer science concepts, patterns, and techniques are presented; 2. Questions are asked and should be discussed in class; 3. Programming labs are given to test students' abilities to apply the concepts taught. CS I begins with the fundamentals of programming, not an immediate exposure to Object-Oriented Programming (OOP). The general philosophy of our program is that students need to first become comfortable with the programming language then OOP design principles can then be introduced. Our program uses various free resources. In CS I, for instance, our primary textbook resource is the Java Jive online material, see Resources area above. Exercises from the JavaBat web site, along with instructor-generated assignments are used for reinforcing course objectives. Each student has his/her own workstation and has an account on the local school domain via a LAN. The student is expected to learn how to store and retrieve data via the network. Lectures are done using a projector and whiteboard while the student follows along on his own workstation using an electronic version of the textbooks. As a lecture progresses, each student is expected to run the code being discussed on his own workstation using an IDE. Eclipse is used as the IDE because it is a free download and its acceptance and support in the Java Development Community. Most class periods are approximately one-third lecture with the remainder of the time spent in either lab or written work. Near the completion of the CS I course the Advanced Placement (AP) Computer Science course is discussed with the students. AP course expectations are discussed with the students so they will make an informed decision whether to elect the AP course. Students who wish to stay with Computer Science, but yet do not want the rigors of the AP course, elect to take Computer Science II (CS II). CS II will explore OOP concepts, but will not explore the advanced concepts addressed in the AP curriculum. The first year AP course focuses on the “A” subset, course title AP Computer Science A. Depending on student ability and time, some of the “B” subset will also be explored. However, students have the opportunity to continue the AP curriculum in a third year course where the “B” subset is specifically addressed, course title AP Computer Science AB. Similiarly to the CS I course the AP course takes advantage of free resources for delivering course content. The Blue-Pelican textbook is utilized as a guide for covering AP course content. The online free resources have been chosen primarily because they sufficiently cover AP stated objectives, and they provide the remote accessibility that is essential for today’s student, particularly the Computer Science student. In addition such resources are normally dynamic and quickly adapt to changes in the language and the field of Computer Science. The only commercial item that is provided to the students is Barron’s preparation guide cited in the resources section. Computer Science Program Page 2 A note regarding the layout of this syllabus/outline: In the CS I and AP A course section, a column exists labeled AP Correlation. The AP Correlation columns displays the items from the Topic Outline of AP Computer Science Course Description that are being addressed/emphasized within a particular unit of study. Items are not repeated after they are identified to prevent repetition. The assumption should be made such topics are reinforced throughout the remainder of the course. Also note that in the CS I portion of this outline we provide prior to the specific Unit objectives a list of the Java Language AP Subset that is addressed in the CS I course. Resources: Cook, Charles. (2007). Blue Pelican Java Textbook. Refugio, Texas: Blue Pelican Book Company. Retrieved February 27, 2007, from World Wide Web: http://www.bluepelicanjava.com/index.htm Kjell, Bradley. Introduction to Computer Science using Java. Central Connecticut State University, Revised and Expanded, January 2006: http://chortle.ccsu.ctstateu.edu/java5/cs151java.html Jones, William C Jr.. (2004). Java Au Naturel. Retrieved July 1, 2007, from World Wide Web: http://www.cs.ccsu.edu/~jones/book.htm Parlante, Nick. JavaBat. 2006. http://javabat.com/. rd Teukolsky, Roselyn. Barron’s AP Advanced Placement Exam Computer Science 2007 Levels A and AB. Barron’s Educational Series, Inc., 3 Edition, 2006. Weiser, Kathy. Java Jive: An Introduction to Java Programming Using the JJ2 Educational Environment. 2004 http://www.home.earthlink.net/~teachcs/jj.html April 2007 Computer Science Program Page 3 CS I Course Syllabus : Unit I: Introduction to Computer Systems (VI. Computing in Context from AP Topic Outline) (2 Weeks) A working knowledge of the major hardware and software components of computer systems is necessary for the study of computer science, as is the awareness of the ethical and social implications of computing systems. Course Objectives: The student will: learn about user responsibility, become aware of district policies, learn ethical & social implications of responsible computer, network, and internet use, learn about piracy and intellectual property. observe and learn the physical components of a PC, become familiar with operating systems and various computer languages. convert between the following systems: o Binary o Hexadecimal o Decimal Types of Topics: Ethics Hardware and software components Materials: AP Correlation http://chortle.ccsu.edu/CS151/cs151java.html (Kjell) Chapters 1-5; Teacher-Generated Worksheets: Binary to Decimal Conversions; Decimal to Binary Conversions; Hexidecimal to Decimal Conversions; Decimal to Hexadecimal Conversions; VI. Computing in Context A working knowledge of the major hardware and software components of computer systems is necessary for the study of computer science, as is the awareness of the ethical and social implications of computing systems. These topics need not be covered in detail, but should be considered throughout the course. A. Major hardware components 1. Primary and secondary memory 2. Processors 3. Peripherals B. System software 1. Language translators/compilers 2. Virtual machines 3. Operating systems C. Types of systems 1. Single-user systems 2. Networks D. Responsible use of computer systems 1. System reliability 2. Privacy 3. Legal issues and intellectual property 4. Social and ethical ramifications of computer use April 2007 Computer Science Program Page 4 Unit II: Introduction to JAVA (2 Weeks) from College Board, AP Subset covered: 10. The escape sequences inside strings \\, \", \n are part of the AP Java subset. The \t escape and Unicode \uxxxx escapes are not in the subset. The \' escape is only necessary inside character literals and is not in the subset. 12. Testing of output is restricted to System.out.print and System.out.println. As with user input, there are many possible ways for directing the output of a program, for example to System.out, to a file, or to a text area in a graphical user interface. The AP Java subset includes the ability to print output to System.out, because it makes it easy to formulate questions. Since most graphical environments allow printing of debug messages to System.out (with output being collected in a special window, e.g. the "Java console" in a browser), students are usually familiar with this method of producing output. Formatted output (e.g., with NumberFormat) is not in the subset. 19. The AP Java subset uses /* */, // and /** */ comments. Javadoc comments @param, @return, and @throws are not part of the subset. April 2007 Computer Science Program Page 5 --Unit II continued— Course Objectives: The student will: define a computer program and identify reasons to learn Computer Science and to learn how to program. identify several characteristics of the Java programming language. understand what the compiler does and it's relationship to programming. understand the following basics of the Java Environment: o The Java Virtual Machine o How Java programs work on the computer o What is an IDE? o Basic editing with the Eclipse IDE o The Eclipse tutorial write a simple Java program with emphasis on the following: o output statements; o basic syntax i.e. semicolons o documentation o error messages o escape characters o debugging o main method Topics: program Java object-oriented programming (OOP) secure robust portable edit window compiles error message statement console window main method string semicolon code snippet documentation debugging escape character compiler Java byte code java virtual machine (JVM) interpreter Materials: AP Correlation Java Jive 0 (Weiser) April 2007 Computer Science Program Page 6 Unit III: Basics of Java Programming (Simple Data Types and Arithmetic Operators) (5 Weeks) from College Board, AP Subset covered: 1. The primitive types int, double, and boolean are part of the AP Java subset. The other primitive types short, long, byte, char, and float are not in the subset. In particular, students need not be aware that strings are composed of char values. Introducing char does not increase the expressiveness of the subset. Students already need to understand string concatenation, String.substring, and String.equals. Not introducing char avoids complexities with the char/int conversions and confusion between "x" and 'x'. 2. Arithmetic operators: +, -, *, /, % are part of the AP Java subset. 3. The increment/decrement operators ++ and -- are part of the AP Java subset. These operators are used only for their side effect, not for their value. That is, the postfix form (for example, x++) is always used, and the operators are not used inside other expressions. For example, a[x++] is not used. 4. The assignment operator = is part of the AP Java subset. The combined arithmetic/assignment operators +=, -=, *=, /=, %= are part of the AP Java subset although they are used simply as a shorthand and will not be used in the adjustment part of a for loop. 9. String concatenation + is part of the AP Java subset. Students are expected to know that concatenation converts numbers to strings and invokes toString on objects. String concatenation can be less efficient than using the StringBuffer class. However, for greater simplicity and conceptual clarity, the StringBuffer class is not in the subset. Course Objectives: The student will: learn when to use comments and how to mark them differentiate between different types of comments. understand what is meant by reserved words and standard names. learn to space and indent blocks of code. identify and understand the three types of programming errors: syntax, run-time, and logic. Topics: variable int execute assignment sta assignment operator output statement trace application public class public static void main user input library import statement Materials: AP Correlation Java Jive: Chapters 1,2,3,4,5,9; (Weiser) JavaBat Exercises April 2007 Computer Science Program Page 7 --Unit III continued— Course Objectives: The student will: understand variables and learn how to declare fields and local variables o int, double , String learn about arithmetic operators, compound assignment operators, and increment / decrement operators. learn how to avoid common mistakes in arithmetic. understand what is meant by casting and purpose of casting numeric types. learn to use simple String operations: o concatenation. o length( ) method o substring o toLowerCase( o toUpperCase () explore the MATH class and various methods within the MATH class. become familiar with the purpose and location of the JAVA API. Topics: Materials: AP Correlation double quotient truncate remainder % modulus operator operator precedence reserved words syntax syntax error run-time error logic error OBOB type casting fixed-point notation floating-point notation Math class Java.lang.* Math.PI Math.abs() Math.pow() Math.sqrt() method String concatenation operator April 2007 Computer Science Program Page 8 Unit IV: Control Structures (12 Weeks) A control structure is a part of a program that regulates the flow of program statements. You will learn to use several different control statements in the next few chapters. In this chapter, you will learn about if-statements and if-else statements. These statements allow the program to make decisions. from College Board, AP Subset covered: 5. Relational operators ==, !=, <, <=, >, >= are part of the AP Java subset. 6. Logical operations &&, ||, ! are part of the AP Java subset. Students need to understand the "short circuit" evaluation of the && and || operators. The logical &, | and ^ and the bit operators <<, >>, >>>, &, ~, |, ^ are not in the subset. 15. The control structures if, if/else, while, for, (including the enhanced for loop), return are part of the AP Java subset. The do/while, switch, plain and labeled break and continue statements are not in the subset. Course Objectives: The student will: learn about the boolean data type. learn the syntax for if-else statements. learn about relational and logical operators, De Morgan’s laws, short-circuit evaluation. learn when to use nested if-else statements, if-else-if sequences, the switch statement. learn the Java syntax for for, while and do-while loops. learn how to use nested loops. Topics: control structure if-statement Boolean expression if-else statement relational operator nested if-statement else-if ladder Boolean operator truth table equals() method memory address for-loop count-controlled loop counter variable iteration increment the counter variable decrement the counter variable nested for loops initialize the counter variable infinite loop while loop count-controlled loop event-controlled loop sentinel error trap robust Materials: AP Correlation Java Jive: Chapters 6,7,8; (Weiser) Teacher Generated Assignments; JavaBat Exercises April 2007 Computer Science Program Page 9 Unit V: GUI Development (5 Weeks) At this point in CS I, we will be using GUIs for input and output. Of course, in order to develop our GUIs some OOP concepts such as inheritance will be utilized. Also, the development of an object and perhaps the passing and receiving of arguments for methods will be done. However, such concepts are not the emphasis at this stage, merely they are thought of as a means to an end. I certainly discuss the OOP concepts as they arise. At this point in the course, my hope is the students will demonstrate understanding of JAVA language features discussed to date in a more engaging environment. Course Objectives: The student will: learn to use basic swing components, their methods, and events they generate. learn use a systematic approach to GUI development. learn to create applets and embed applets into .html source code. Topics: JLabel JButton JToggleButton JCheckBox JComboBox JSlider JTextField JPasswordField JTextArea Applets GUI components Other applet methods Paint and repaint graphics Event driven programming Event objects Listener class Adapter class Inner classes Anonymous classes Materials: AP Correlation http://chortle.ccsu.edu/CS151/cs151java.html (Kjell) Part Eight; Teacher Generated Assignments; April 2007 Computer Science Program Page 10 Unit VI: Arrays (5 Weeks) from College Board, AP Subset covered: 14. Arrays: one-dimensional arrays and two-dimensional rectangular arrays are part of the AP Java subset. Both arrays of primitive types (e.g., int[]) and arrays of objects (e.g., Student[] ) are in the subset. Initialization of named arrays (int[] arr = { 1, 2, 3 };) is part of the AP Java subset. Two-dimensional arrays will only be tested on the AB exam. Arrays with more than two dimensions (e.g., rubik = new Color[3][3][3]) are not in the subset. "Ragged" arrays (e.g., new int[3][]) are not in the subset. In particular, students do not need to know that an int[3][3] really is an "array of arrays" whose rows can be replaced with other int[] arrays. However, students are expected to know that arr[0].length is the number of columns in a rectangular two-dimensional array arr. Anonymous arrays (e.g., new int[] { 1, 2, 3 }) are not in the subset. Course Objectives: The student will: learn about arrays and when to use them. learn the syntax for declaring and initializing arrays. learn how to access array’s size and elements Topics: Variables in arrays Index Arrays of primitives Arrays of objects Declaring arrays Use subscripts to access elements of an array Initializing Arrays Array of primitives Array of elements Using initializer blocks Materials: AP Correlation http://chortle.ccsu.edu/CS151/cs151java.html (Kjell) Part Six; Teacher Generated Assignments; JavaBat Exercises April 2007 Computer Science Program Page 11 Unit VII: Introduction to Object Oriented Programming (5 Weeks) Object-oriented programming is an approach that models the actions of real-world objects, is easy to understand (once you get the hang of it!), and can be reused in a variety of situations. A class is a template from which an object is created. An object is an instance of a class that can be manipulated by a client program. Each object has both behaviors and attributes. from College Board, AP Subset covered: 17. Classes: Students are expected to construct objects with the new operator, to supply construction parameters, and to invoke accessor and modifier methods. Students are expected to modify existing classes (by adding or modifying methods and instance variables). Students are expected to design their own classes. Course Objectives: The student will: understand the purpose, correct implementation, and utilize methods of the Random Class understand the purpose and correct use of a constructor. know how to create a new object using the new reserved word understand the concept of a client program in application design understand the relationship between classes and objects identify and understand the components of class design: attributes and behaviors (variables/fields and methods) identify and differentiate between two types of methods: accessors and mutators learn the syntax and style for defining and calling methods and constructors learn how arguments are passed to methods and constructors and how to return values from methods Topics: client program private instance variable new invoke constructor actual parameter header formal parameter object-oriented programming class object attributes behaviors private public state instantiate default constructor return statement accessor methods Materials: AP Correlation Java Jive: Chapters 10 and 11; (Weiser) Teacher Generated Assignments; April 2007 Computer Science Program Page 12 AP A Course Syllabus : Unit I: Review of Java Language Basics and Introduction to Casting (2 Weeks) (Review fundamental programming concepts: loops, decision structures, data types, Math class, simple String methods) Course Objectives: The following areas will be addressed signature of a method remarks (REMS) using the println method to produce output. create String, int, and double type variables learn the difference between initializing and declaring learn how to create legal variable names. concatenation, length, substring, toLowerCase, toUpperCase escape sequences. assignment, incrementing, decrementing, compound operators modulus rules concerning integer & double arithmetic and round-off. uses of the keyword final, mixing data types in an expression casting. the fundamental methods of Math, the advanced methods using trigonometry and some of the higher math functions. the Scanner class in general using nextInt, nextDouble, next, and nextLine to input from the keyboard. the boolean data type Boolean operators AND and OR, precedence of Boolean operations. Topics: Fundamentals of the main method Data Types Simple String operations Using numeric variables Mixed data types, casting, and constants The Math class Input from keyboard Boolean types and operators The if statement The switch statement, character type The for loop while and do-while loops ASCII codes and advanced Character methods Materials: AP Correlation Reading: Blue Pelican Java, Lesson 1, Appendix N; Programs: From Me To You Simple main method using rems and println. II. Program Implementation The overall goals of program implementation parallel those of program design. Classes that fill common needs should be built so that they can be reused easily in other programs. Object-oriented design is an important part of program implementation. Reading: Blue Pelican Java, Lesson 2, Appendix C: Reading: Blue Pelican Java, Lesson 3 Programs: Name That Celebrity: o Makes use of several String methods. B. Programming constructs 1. 2. Reading: Blue Pelican Java, Lesson 4 Programs: Cheating On Your Arithmetic Assignment Use the above methods and rules on math problems. Reading: Blue Pelican Java, Lesson 5 3. Reading: Blue Pelican Java, Lesson 6 Programs: Compute This o Using complex math expressions Reading: Blue Pelican Java, Lesson 7, Appendix M, Programs: Going in circles: o Given the area of a circle, compute its radius. What’s My Name? o Input first and last name from the keyboard, then print the full name. Reading: Blue Pelican Java, Lesson 8, Appendix H 4. Primitive types vs. objects Declaration a. Constant declarations b. Variable declarations Console output (System.out.print/println) Control a. Methods b. Sequential c. Conditional d. Iteration IV. Standard Data Structures Data structures are used to represent information within a program. Abstraction is an important theme in the development and application of data structures. A. Simple data types (int, boolean, double) April 2007 Computer Science Program Page 13 --Unit I continued— Course Objectives: the syntax of the if-else statement uses of the if statement. the syntax of the if-else statement uses of the if statement the syntax of a for loop breaking out of a loop and the continue statement variable scope relative to a loop. the syntax of a while loop the syntax of a do-while loop the advantages of each and comparison to a for loop the uses of ASCII codes the specific codes for the alphabet and numbers conversion from String to char and vice versa advanced methods of the Character class. Topics: Materials: AP Correlation Reading: Blue Pelican Java, Lesson 9: Programs: Even or Odd? o Input integers from the keyboard and use modulus to determine if even or odd. III. Program Analysis The analysis of programs includes examining and testing programs to determine whether they correctly meet their specifications. It also includes the analysis of programs or algorithms in order to understand their time and space requirements when applied to different data sets. Reading: Blue Pelican Java, Lesson 10 Programs: Weight on Other Planets o Use the switch statement to determine and respond to input from a screen menu. Reading: Blue Pelican Java, Lesson 11: Programs: Name Reversal Input names from the keyboard. Use a loop to print the name in reverse order. A. B. Reading: Blue Pelican Java, Lesson 12: Reading: Blue Pelican Java, Lesson 13, Appendix D; Programs: JavaBat C. Testing 1. Identify boundary cases and generate appropriate test data Debugging 1. Categorize errors: compile-time, runtime, logic 2. Identify and correct errors 3. Techniques: use a debugger, add extra output statements, hand-trace code Understand and modify existing code April 2007 Computer Science Program Page 14 Unit II: Number systems, creating classes & objects, advanced String methods, advanced array concepts, static methods and variables, wrapper classes (3 Weeks) Course Objectives: The following areas will be addressed: the basic structure of a number system conversions to and from binary, hex, and decimal numbers arithmetic operation in binary, hex, and decimal. the structure of the signature of a class instantiating objects creating a class with a constructor, various public, methods, private methods, and state variables the compareTo, indexOf, charAt, replace, and trim methods parsing Strings using the Scanner class declaring and initializing an array determining the length of an array usage of the split method references to an array the methods of the Arrays class command line arguments the enhanced for-loop. uses and applications of static methods and variables static imports converting primitives to objects and vice versa auto-boxing and unboxing the methods parseInt, parseDouble, toHexString, toOctalString toBinaryString, and toString. Topics: Binary, hex, octal number systems Fundamentals of classes and objects Advanced String methods Singly dimensioned arrays Using static state variables and methods Wrapper classes Materials: AP Correlation Reading: Blue Pelican Java, Lesson 14, Appendices G and Y Programs: Basically Speaking o Print a table that gives the equivalent numbers in decimal, binary, hex, and octal. III. Program Analysis The analysis of programs includes examining and testing programs to determine whether they correctly meet their specifications. It also includes the analysis of programs or algorithms in order to understand their time and space requirements when applied to different data sets. Reading: Blue Pelican Java, Lesson 15, 16: Programs: What’s that diameter?: o Create a Circle class with a constructor and a diameter method. Overdrawn at the Bank: o Create a BankAccount class having a balance state variable, and with withdraw & deposit methods. Create objects from within the main method of a different class. Gas Mileage: o Create an Automobile class into which we can assignment fuel consumption, miles driven, and a gas tank variable that can be “filled”. Reading: Blue Pelican Java, Lesson 17, Appendix AC Programs: Add ‘em Up: o Use Scanner to parse and arithmetic expression and then evaluate Encryption/Decryption: o Use the Scanner class to encrypt and decrypt secret messages. H. Numerical representations and limits 1. Representations of numbers in different bases 2. Limitations of finite representations (e.g., integer bounds, imprecision of floatingpoint representations, and round-off error) IV. Standard Data Structures Data structures are used to represent information within a program. Abstraction is an important theme in the development and application of data structures. B. C. Classes One-dimensional arrays April 2007 Computer Science Program Page 15 --Unit II continued— Course Objectives: Topics: Materials: AP Correlation Reading: Blue Pelican Java, Lesson 18, 19, Appendix AC; Programs: Count ‘em Right: o Use split to count occurrences. Array of Hope: o Use loops to fill a character array Sorting a String Array: o Uses Arrays.sort Two Orders for the Price of One II. Program Implementation The overall goals of program implementation parallel those of program design. Classes that fill common needs should be built so that they can be reused easily in other programs. Object-oriented design is an important part of program implementation. Reading: Blue Pelican Java, Lesson 20, Appendix I Programs: o How far to the Line: o Calculate distance from a point to a line using static state variables. Reading: Blue Pelican Java, Lesson 21, 22, Appendix C Programs: JavaBat A. Implementation techniques 1. Methodology a. Object-Oriented development b. Top-down development c. Encapsulation and information hiding B. Programming constructs 2. Declaration c. Class declarations e. Method declarations f. Parameter declarations III. Program Analysis The analysis of programs includes examining and testing programs to determine whether they correctly meet their specifications. It also includes the analysis of programs or algorithms in order to understand their time and space requirements when applied to different data sets. A. F. Testing 1. Identify boundary cases and generate appropriate test data. Reason about programs 1. Pre- and post conditions 2. Assertions April 2007 Computer Science Program Page 16 Unit III: Input and output from a disk file, formatting text, bitwise operators, random numbers, StringBuffer, Boolean algebra. (3 Weeks) Course Objectives: The following areas will be addressed: using the Scanner class to read a disk file using throws IOException the methods necessary to create and send output to a text file appending to an existing text file. using the NumberFormat class using the Formatter class and printf uses of bitwise AND, OR, and exclusive-OR the sign bit, most significant bit, and negative numbers the “shifting” operators short-circuiting how to create a Random object and then create ranges of random integers and doubles applications of random numbers; games, simulations the problems caused by repetitive manipulations of Strings how to overcome these problems with a StringBuffer object how to write a Boolean expression as an algebraic expression how to manipulate and simplify such an expression how to construct truth tables DeMorgan’s theorem and its uses and applications how to convert an if-else expression to selection operator syntax how to convert selection operator syntax to if-else syntax. Topics: Processing file input Writing to a text file Formatting text Bitwise operators Random numbers StringBuffer class Boolean algebra Selection operator Materials: AP Correlation Reading: Blue Pelican Java, Lesson 21, 22, 27 Programs: Reading Files: o The basics of reading in a file and then printing it to the screen Get Rid of that Plus Sign: o Input math problems and parse according to arithmetic operations Student averages: o Input student grade data and compute average grades Gymnastics: o Input data from Olympic judges and computer scores Reading: Blue Pelican Java, Lesson 26, Appendices E and F Programs: o Write Student Averages: o Input student grade data and write the computer averages to a different text file. Reading: Blue Pelican Java, Lesson 27, Appendices Z and AD. Reading: Blue Pelican Java, Lesson 28, 29, Appendix H Programs: o Tweaking for speed: o Using shifting to make a program run faster. Reading: Blue Pelican Java, Lesson 30 Programs: o Monte Carlo Technique: o Using random “rain drops” to produce an estimate of PI. Reading: Blue Pelican Java, Lesson 31 Programs: o Concatenations Gone Wild: o Use StringBuffer for multiple concatenations April 2007 Computer Science Program Page 17 --Unit III continued— Course Objectives: Topics: Materials: AP Correlation Reading: Blue Pelican Java, Lesson 32 Reading: Blue Pelican Java, Lesson 33 April 2007 Computer Science Program Page 18 Unit IV: Selection operator, passing by value and reference, two-dimensional arrays, inheritance, exceptions, interfaces, complexity analysis, recursion. (9 Weeks) Course Objectives: The following areas will be addressed: o o o o o o o o o o o o o o that primitives and strings are passed by value to methods that objects are passed by reference to methods how to declare and initialize twodimensional arrays, using the Arrays class with twodimensional arrays to create a class that inherits another to distinguish between abstract, final, overriding, and shadowing as applied to classes and methods two type of exceptions: checked and unchecked two ways to handle exceptions: with throws and with try-catchfinally to distinguish between the implementation and object perspectives to create a class that implements an interface how to use instanceOf. the basic principles of recursion how to generate factorials with recursion how to generate a Fibonacci sequence with recursion. Topics: o Passing by value and by reference o Two-dimensional arrays o Inheritance o Exceptions o Interfaces o Complexity analysis o Recursion Materials: AP Correlation Reading: Blue Pelican Java, Lesson 34 Programs: o Pass the Gravy, Please: o A demonstration of passing primitives and objects to a method. I. Object-Oriented Program Design The overall goal for designing a piece of software (a computer program) is to correctly solve the given problem. At the same time, this goal should encompass specifying and designing a program that is understandable, can be adapted to changing circumstances, and has the potential to be reused in whole or in part. The design process needs to be based on a thorough understanding of the problem to be solved. A. Program design 1. Read and understand a problem's description, purpose, and goals. 2. Apply data abstraction and encapsulation. 3. Read and understand class specifications and relationships among the classes ("is-a", "has-a" relationships). 4. Understand and implement a given class hierarchy 5. Identify reusable components from existing code using classes and class libraries. B. Class design 1. Design and implement a class. Design an interface. 2. Choose appropriate data representation and algorithms. 3. Apply functional decomposition. 4. Extend a given class using inheritance. Reading: Blue Pelican Java, Lesson 35, Appendix AA; Programs: o Matrix Multiplication: o Multiply two matrices o Matrix Multiplication with File Input Reading: Blue Pelican Java, Lesson 36; Reading: Blue Pelican Java, Lesson 37, Appendix K; Programs: o Keep Trying o Uses a loop to keep trying a task if an error is detected. Programs: o Java au Naturel, Chapter 9 Reading: Blue Pelican Java, Lesson 38, Appendix L; Programs: o Linear Function o Create a class that implements an interface and returns information about a linear function. Reading: Java Au Naturel, Chapter 11 Programs: Java Au Naturel, Chapter 11 Reading: Blue Pelican Java, Lesson 40: Programs: o Fibonacci. April 2007 Computer Science Program Page 19 --Unit IV continued— Course Objectives: Topics: Materials: AP Correlation II. Program Implementation The overall goals of program implementation parallel those of program design. Classes that fill common needs should be built so that they can be reused easily in other programs. Object-oriented design is an important part of program implementation. A. Implementation techniques 1. Methodology d. Procedural abstraction B. Programming constructs 1. Declaration d. Interface declarations 4. Control e. Recursion III. Program Analysis The analysis of programs includes examining and testing programs to determine whether they correctly meet their specifications. It also includes the analysis of programs or algorithms in order to understand their time and space requirements when applied to different data sets. D. E. Extend existing code using inheritance Understand error handling 1. Understand runtime exceptions April 2007 Computer Science Program Page 20 Unit V: Sorting routines, List interface, ArrayList, Iterator/ListIterator, Comparable/Comparator, and Binary Search. (9 Weeks) Course Objectives: The following areas will be addressed: o o o o o o o o o o o Selection, Insertion, and Merge Sorts the methods of the List interface the classes that implement this interface how to use and apply the ArrayList the methods of both the Iterator and the ListIterator how to use iterators to accesss the elements of a list. how to compare objects with Comparable, how to compare objects with Comparator to do an iterative search of an ordered array to do a recursive search of an ordered array to use the Arrays class to sort and do binary a search. Topics: Sorting List interface ArrayList Iterator, ListIterator Comparable, Comparator o Binary search o o o o o Materials: AP Correlation Reading: Blue Pelican Java, Lesson 41 Programs: o Multiple Key Sorting : o Write a sort routine sorting first by name and then by age.. Programs: o Java au Naturel, Chapter 13 V. Standard Algorithms Standard algorithms serve as examples of good solutions to standard problems. Many are intertwined with standard data structures. These algorithms provide examples for analysis of program efficiency. Reading: Blue Pelican Java, Lesson 42 A. Operations on A-level data structures listed above 1. Traversals 2. Insertions 3. Deletions B. Searching 1. Sequential 2. Binary Sorting 1. Selection 2. Insertion 3. Mergesort Reading: Blue Pelican Java, Lesson 43 Programs: o Big Bucks in the Bank: o Use an ArrayList object to hold BankAccount objects Reading: Blue Pelican Java, Lesson 44 Programs: o Big Buck Revisited: o Access the objects in a list using an iterator. Reading: Blue Pelican Java, Lesson 45 Programs: o Bank Account ObjectsUsing Comparator o Sorting Bank Account Objects Alphabetically o Sorting Bank Account Objects Alphabetically using Comparator Reading: Blue Pelican Java, Lesson 51 Programs: o Bnary Search, Reverse Order o Binary Search with Objects Programs: o Java au Naturel, Chapter 13 C. III. Program Analysis The analysis of programs includes examining and testing programs to determine whether they correctly meet their specifications. It also includes the analysis of programs or algorithms in order to understand their time and space requirements when applied to different data sets. G. Analysis of algorithms 1. Informal comparisons of running times 2. Exact April 2007 Computer Science Program Page 21 --Unit V continued— Course Objectives: Topics: Materials: AP Correlation II. Program Implementation The overall goals of program implementation parallel those of program design. Classes that fill common needs should be built so that they can be reused easily in other programs. Object-oriented design is an important part of program implementation. C. Java library classes (included in the A-level AP Java Subset) April 2007 Computer Science Program Page 22 Unit VI: Grid World Case Study and AP Exam Preparation (6 Weeks) Course Objectives: The following areas will be addressed: o o o o o o Chapter 1 o Readings o Exercises Chapter 2 o Readings o Exercises Chapter 3 o Readings o Exercises Chapter 4 o Readings o Exercises answer appropriate free-response questions answer appropriate multiplechoice questions. Topics: o o Materials: Grid World Case Study AP Exam Preparation AP Correlation Reading: Grid World case study on the College Board web site. 2004 AP Computer Science A Exam Multiple Choice Questions All released Free-Response Questions from College Board Readings, Sample Multiple Choice and Free Response Questions from Barron’s Preparation Guide April 2007 Computer Science Program Page 23 AP AB Course Syllabus : Unit I: Review of Computer Science Program to date. (4 Weeks) Course Objectives: A thorough review of all AP A concepts will be conducted with a specific emphasis on the following concepts and programming constructs: Encapsulation Inheritance Polymorphism Interfaces Abstract Classes Recursion ArrayLists Exceptions Topics: Encapsulation Inheritance Polymorphism Interfaces Abstract Classes Recursion ArrayLists Exceptions Materials: AP Correlation Blue Pelican Text I. Object-Oriented Program Design The overall goal for designing a piece of software (a computer program) is to correctly solve the given problem. At the same time, this goal should encompass specifying and designing a program that is understandable, can be adapted to changing circumstances, and has the potential to be reused in whole or in part. The design process needs to be based on a thorough understanding of the problem to be solved. Reading Java Au Naturel, Chapters 1 – 5; Programs Java Au Naturel, Chapters 1 – 5; A. Program Design 1. Specify the purpose and goals for a problem. 3. Decompose a problem into classes; define relationships and responsibilities of those classes. B. Class design 1. Design and implement a set of interacting classes. 2. Design an interface. III. Program Analysis The analysis of programs includes examining and testing programs to determine whether they correctly meet their specifications. It also includes the analysis of programs or algorithms in order to understand their time and space requirements when applied to different data sets. C. Understand error handling 1. Throw runtime exceptions April 2007 Computer Science Program Page 24 Unit II: Sorting routines, List interface, ArrayList, Iterator/ListIterator, Comparable/Comparator, HashSet/TreeSet, HashMap/TreeMap, Flow Charts, LinkedList, binary search (9 Weeks) Course Objectives: The following areas will be addressed: Quick Sort determine a Big O value for an algorithm. the methods of the List interface the classes that implement this interface. the methods of both the Iterator and the ListIterator how to use iterators to accesss the elements of a list. how to implement classes using the Set interface how to use iterators with Set objects how to solve problems using HashSet & TreeSet. the meaning and uses of keys and values as applied to HashMap & TreeMap how to implement classes using the Map interface how to use iterators with Map objects. the methods of the LinkedList class (push, pop, etc) how to use LinkedList to build a Stack class Topics: Quicksort Complexity analysis List interface Iterator, ListIterator Sets Maps The LinkedList class, stacks Materials: AP Correlation Reading Java Au Naturel, Chapter 13; readings related to quicksort and BigOh Programs Java Au Naturel, Chapter 13; assignments related to quicksort and BigOh IV. Standard Data Structures Data structures are used to represent information within a program. Abstraction is an important theme in the development and application of data structures. D. Reading: Blue Pelican Java, Lesson 39 Reading: Blue Pelican Java, Lesson 42 Reading: Blue Pelican Java, Lesson 44 Programs: Big Buck Revisited: Access the objects in a list using an iterator. Reading: Blue Pelican Java, Lesson 46: Appendix W Programs: HashSet Intersection; Find the intersection of sets. HashSet Union; Find the union of sets. Reading: Blue Pelican Java, Lesson 47 Programs: Mapping BankAccount objects Code Talker; Mapping words to a coded version. Histogram; Mapping words to a frequency count. Student Classification; Mapping names to a grade. Reading: Blue Pelican Java, Lesson 50 Programs: StackLL Class; Creating a stack class using LinkedList Stack Calculator; Create a stack calculator class E. F. K. L. Two-Dimensional Arrays (addressed previously in AP A course content) Linked Lists (singly, doubly, circular) Stacks Sets Maps V. Standard Algorithms Standard algorithms serve as examples of good solutions to standard problems. Many are intertwined with standard data structures. These algorithms provide examples for analysis of program efficiency. A. Operations on AB-level data structures previously listed 3. Traversals 4. Insertions 5. Deletions 6. Iterators C. Sorting 4. Quicksort Reading Java Au Naturel, Chapters 14, 15, 16; Programs Java Au Naturel, Chapter 14, 15, 16; April 2007 Computer Science Program Page 25 --Unit II continued— Course Objectives: Topics: Materials: AP Correlation III. Program Analysis The analysis of programs includes examining and testing programs to determine whether they correctly meet their specifications. It also includes the analysis of programs or algorithms in order to understand their time and space requirements when applied to different data sets. D. Analysis of Algorithms 3. Big-Oh notation 4. Worst-case and average-case time and space analysis. I. Object-Oriented Program Design The overall goal for designing a piece of software (a computer program) is to correctly solve the given problem. At the same time, this goal should encompass specifying and designing a program that is understandable, can be adapted to changing circumstances, and has the potential to be reused in whole or in part. The design process needs to be based on a thorough understanding of the problem to be solved. B. Class Design 3. Choose appropriate advanced data structures and algorithms. II. Program Implementation The overall goals of program implementation parallel those of program design. Classes that fill common needs should be built so that they can be reused easily in other programs. Objectoriented design is an important part of program implementation. C. Java library classes (included in the AB-level AP Java Subset) April 2007 Computer Science Program Page 26 Unit III: Binary search trees, queues, heaps, priority queues, lookup tables & hashing, Grid World case study (9 Weeks) Course Objectives: The following areas will be addressed: create and use the methods of a BST class become familiar with preorder, inorder, postorder, and level order traversals create and interpret expression trees. the basic nature of a FIFO implement a LinkedList queue implement an ArrayList queue. fundamentals of heap terminology add and delete heap nodes uses and applications of heaps. implement a priority queue using a heap implement a priority queue using an array uses and applications of priority queues. create and use a simple lookup table the various techniques for creating a hash function handle collisions uses and applications of hashing. GridWorld Case Study o o o Chapter 5 o Readings o Exercises answer appropriate free-response questions answer appropriate multiplechoice questions. Topics: o Binary search trees (BST) Queues Heaps Piority Queues Lookup Tables and Hashing Grid World Case Study AP Exam Preparation Materials: AP Correlation Reading: Blue Pelican Java, Lesson 52; Appendix W Programs: BST find Method; Search a BST IV. Standard Data Structures Data structures are used to represent information within a program. Abstraction is an important theme in the development and application of data structures. Reading: Blue Pelican Java, Lesson 53 Programs: Who’s Next; Use a queue to calculate wait-time in a customer queue. Shifting Marquee; Use a queue to shift characters in a marquee. Reading: Blue Pelican Java, Lesson 55, Appendix AB; Programs: Printing a Heap; Print the contents of a heap by rows. A Heap of Trouble; Access and print the nodes of a heap so as to make a “pictorially correct” tree. Reading: Blue Pelican Java, Lesson 56; Programs: Who Has Highest Priority; Write code for various methods of a priority queue. Smile for the Camera; Print a “snapshot” of a priority queue. Reading: Blue Pelican Java, Lesson 57; Programs: A taste of Hash; Create and use a simple hash function using modulus. Hashing Abraham Lincoln; Create a more complex hash function using Presidents’ names as keys. Reading Java Au Naturel, Chapters 17 and 18; Programs Java Au Naturel, Chapter 17 and 18; G. H. I. J. Queues Trees Heaps Priority queues V. Standard Algorithms Standard algorithms serve as examples of good solutions to standard problems. Many are intertwined with standard data structures. These algorithms provide examples for analysis of program efficiency. A. Operations on AB-level data structures previously listed 1. Traversals 2. Insertions 3. Deletions 4. Iterators B. Searching 3. Hashing C. Sorting 5. Heapsort Reading: Grid World case study on the College Board web site. 2004 AP Computer Science AB Exam Multiple Choice Questions All released Free-Response Questions from College Board Readings, Sample Multiple Choice and Free Response Questions from Barron’s Preparation Guide April 2007 Computer Science Program Page 27 Unit IV: PHP and MYSQL (14 Weeks) Unit IV exposes students to the PHP, server-side scripting language, and incorporates this language with the MYSQL, open source database server. Obviously students are introduced to client-server model of programming and basic syntax of both languages. Then various school-based projects are identified, so students can demonstrate understanding of the entire Computer Science background. April 2007