Sources
CSP & CSA: Collegeboard.
Logic: http://intrologic.stanford.edu/
HTML & CSS: "HTML & CSS design and build websites" -Jon Duckett.
GIMP: https://www.gimp.org/tutorials/
CSP & CSA: Collegeboard.
Logic: http://intrologic.stanford.edu/
HTML & CSS: "HTML & CSS design and build websites" -Jon Duckett.
GIMP: https://www.gimp.org/tutorials/

×
Class Sylabus | |
Teacher | Mr. Wiessmann |
Subject | AP Computer Science A |
edwiessmann@philasd.org | |
Cell Phone | 215-900-8742 |
School Phone | 215-351-7618 |
Book | Java Methods |
Online Book | https://runestone.academy/runestone/default/user/login?_next=/runestone/default/index |
Course Description | "The proposed syllabus is for a full school year course. The course meets for five 50-minute class periods per week. The course includes a number of individual programming projects assigned for one week each. The time after the AP CS Exam is devoted to a team project and enrichment activities. The course is based on numerous problem solving exercises, labs, and case studies, which require students to design and implement Java classes. [CR1] The course requires 40-50 hours of hands-on work in a computer lab.[CR6]"** |
AP Computer Science Course Homepage: | https://apcentral.collegeboard.org/courses/ap-computer-science-a/course |
AP Computer Science College Board Description: | https://apcentral.collegeboard.org/pdf/ap-computer-science-a-course-description.pdf?course=ap-computer-science-a |
Classroom Website: | phillycomputerscience.com |
AP CSA Exam Date: | Tuesday, May 5, 2020 Noon |
AP Exam Schedule: | https://professionals.collegeboard.com/testing/ap/about/dates |
Materials List | Litvin, Maria, and Gary Litvin. Java Methods: Object-Oriented Programming and Data Structures, 2nd AP Edition, Andover, Mass.: Skylight Publishing, 2011. The College Board’s Magpie, Picture, and Elevens Labs Student Guides. CodingBat: http://codingbat.com/java Java Methods student files, teacher files, Powerpoints, Test Package, additional resources at http://www.skylit.com/javamethods and http://www.skylit.com/projects/. Resourses found on PhillyMathClass.com |
Class Rules: | Students must obey the school wide rules of the Academy @ Palumbo at all times. |
Tutoring | After School Tuesday 3:00-6:00 by appointment |
×
Big Ideas | |
BIG IDEA 1: MODULARITY (MOD) | Incorporating elements of abstraction, by breaking problems down into interacting pieces, each with their own purpose, makes writing complex programs easier. Abstracting simplifies concepts and processes by looking at the big picture rather than being overwhelmed by the details. Modularity in object-oriented programming allows us to use abstraction to break complex programs down into individual classes and methods. |
BIG IDEA 2: VARIABLES (VAR) | Information used as a basis for reasoning, discussion, or calculation is referred to as data. Programs rely on variables to store data, on data structures to organize multiple values when program complexity increases, and on algorithms to sort, access, and manipulate this data. Variables create data abstractions, as they can represent a set of possible values or a group of related values. |
BIG IDEA 3: CONTROL (CON) | Doing things in order, making decisions, and doing the same process multiple times are represented in code by using control structures and specifying the order in which instructions are executed. Programmers need to think algorithmically in order to define and interpret processes that are used in a program. |
BIG IDEA 4: IMPACT OF COMPUTING (IOC) | Computers and computing have revolutionized our lives. To use computing safely and responsibly, we need to be aware of privacy, security, and ethical issues. As programmers, we need to understand how our programs will be used and be responsible for the consequences. |
×
Units | |
UNIT 1 Primitive Types |
This unit introduces students to the Java programming language and the use of classes, providing students with a firm foundation of concepts that will be leveraged and built upon in all future units. Students will focus on writing the main method and will start to call preexisting methods to produce output. The use of preexisting methods for input is not prescribed in the course; however, input is a necessary part of any computer science course so teachers will need to determine how they will address this in their classrooms. Students will start to learn about three built-in data types and learn how to create variables, store values, and interact with those variables using basic operations. The ability to write expressions is essential to representing the variability of the real world in a program and will be used in all future units. Primitive data is one of two categories of variables covered in this course. The other category, reference data, will be covered in Unit 2. |
UNIT 2 Using Objects |
In the first unit, students used primitive types to represent real-world data and determined how to use them in arithmetic expressions to solve problems. This unit introduces a new type of data: reference data. Reference data allows real-world objects to be represented in varying degrees specific to a programmer’s purpose. This unit builds on students’ ability to write expressions by introducing them to Math class methods to write expressions for generating random numbers and other more complex operations. In addition, strings and the existing methods within the String class are an important topic within this unit. Knowing how to declare variables or call methods on objects is necessary throughout the course but will be very important in Units 5 and 9 when teaching students how to write their own classes and about inheritance relationships. |
UNIT 3 Boolean Expressions and if Statements |
Algorithms are composed of three building blocks: sequencing, selection, and iteration. This unit focuses on selection, which is represented in a program by using conditional statements. Conditional statements give the program the ability to decide and respond appropriately and are a critical aspect of any nontrivial computer program. In addition to learning the syntax and proper use of conditional statements, students will build on the introduction of Boolean variables by writing Boolean expressions with relational and logical operators. The third building block of all algorithms is iteration, which you will cover in Unit 4. Selection and iteration work together to solve problems. |
UNIT 4 Iteration |
This unit focuses on iteration using while and for loops. As you saw in Unit 3, Boolean expressions are useful when a program needs to perform different operations under different conditions. Boolean expressions are also one of the main components in iteration. This unit introduces several standard algorithms that use iteration. Knowledge of standard algorithms makes solving similar problems easier, as algorithms can be modified or combined to suit new situations. Iteration is used when traversing data structures such as arrays, ArrayLists, and 2D arrays. In addition, it is a necessary component of several standard algorithms, including searching and sorting, which will be covered in later units. |
UNIT 5 Writing Classes |
This unit will pull together information from all previous units to create new, user-defined reference data types in the form of classes. The ability to accurately model real-world entities in a computer program is a large part of what makes computer science so powerful. This unit focuses on identifying appropriate behaviors and attributes of real-world entities and organizing these into classes. Students will build on what they learn in this unit to represent relationships between classes through hierarchies, which appear in Unit 9. The creation of computer programs can have extensive impacts on societies, economies, and cultures. The legal and ethical concerns that come with programs and the responsibilities of programmers are also addressed in this unit. |
UNIT 6 Array |
This unit focuses on data structures, which are used to represent collections of related data using a single variable rather than multiple variables. Using a data structure along with iterative statements with appropriate bounds will allow for similar treatment to be applied more easily to all values in the collection. Just as there are useful standard algorithms when dealing with primitive data, there are standard algorithms to use with data structures. In this unit, we apply standard algorithms to arrays; however, these same algorithms are used with ArrayLists and 2D arrays as well. Additional standard algorithms, such as standard searching and sorting algorithms, will be covered in the next unit. |
UNIT 7 ArrayList |
As students learned in Unit 6, data structures are helpful when storing multiple related data values. Arrays have a static size, which causes limitations related to the number of elements stored, and it can be challenging to reorder elements stored in arrays. The ArrayList object has a dynamic size, and the class contains methods for insertion and deletion of elements, making reordering and shifting items easier. Deciding which data structure to select becomes increasingly important as the size of the data set grows, such as when using a large real-world data set. In this unit, students will also learn about privacy concerns related to storing large amounts of personal data and about what can happen if such information is compromised. |
UNIT 8 2D Array |
In Unit 6, students learned how 1D arrays store large amounts of related data. These same concepts will be implemented with two-dimensional (2D) arrays in this unit. A 2D array is most suitable to represent a table. Each table element is accessed using the variable name and row and column indices. Unlike 1D arrays, 2D arrays require nested iterative statements to traverse and access all elements. The easiest way to accomplished this is in row-major order, but it is important to cover additional traversal patterns, such as back and forth or column-major. |
UNIT 9 Inheritance |
Creating objects, calling methods on the objects created, and being able to define a new data type by creating a class are essential understandings before moving into this unit. One of the strongest advantages of Java is the ability to categorize classes into hierarchies through inheritance. Certain existing classes can be extended to include new behaviors and attributes without altering existing code. These newly created classes are called subclasses. In this unit, students will learn how to recognize common attributes and behaviors that can be used in a superclass and will then create a hierarchy by writing subclasses to extend a superclass. Recognizing and utilizing existing hierarchies will help students create more readable and maintainable programs. |
UNIT 10 Recursion |
Sometimes a problem can be solved by solving smaller or simpler versions of the same problem rather than attempting an iterative solution. This is called recursion, and it is a powerful math and computer science idea. In this unit, students will revisit how control is passed when methods are called, which is necessary knowledge when working with recursion. Tracing skills introduced in Unit 2 are helpful for determining the purpose or output of a recursive method. In this unit, students will learn how to write simple recursive methods and determine the purpose or output of a recursive method by tracing. |
** | Most of the text in this Syllabus were taken from Collegeboard CSA resources |
×
TOPIC | Lesson | Assignment |
---|---|---|
Blockchain | https://www.youtube.com/watch?v=hYip_Vuv8J0 | Write a one page summary of what blockchiain is. How did the narrator connect with each audience. What level was most helpful for you? |
IP Address | https://www.youtube.com/watch?v=7_-qWlvQQtY | Find two other sources describing ip addresses and reference theses in your paper. Write a one page summary about how private your data is online based on what you have learned by researching ip addresses. |
Binary Math | https://www.youtube.com/watch?v=XKu_SEDAykw&t=1043s | Write a one page summary on the question that the engineer for google had to answer. Explain the problem and the stages of development the interview went over. Why is communication important? |
Primitive Types
Using Objects
Boolean Expressions and if Statements
Iteration
Writing Classes
Array
ArrayList
2D Array
Inheritance
Recursion
×
UNIT 1: Primitive Types
Overview
AP EXAM WEIGHTING | 2.5–5% |
CLASS PERIODS | ~8–10 |
OVERVIEW | This unit introduces students to the Java programming language and the use of classes, providing students with a firm foundation of concepts that will be leveraged and built upon in all future units. Students will focus on writing the main method and will start to call preexisting methods to produce output. The use of preexisting methods for input is not prescribed in the course; however, input is a necessary part of any computer science course so teachers will need to determine how they will address this in their classrooms. Students will start to learn about three built-in data types and learn how to create variables, store values, and interact with those variables using basic operations. The ability to write expressions is essential to representing the variability of the real world in a program and will be used in all future units. Primitive data is one of two categories of variables covered in this course. The other category, reference data, will be covered in Unit 2. |
1.1 Why Programming? Why Java?
DATES
TOPIC | 1.1 Why Programming? Why Java? | ||
---|---|---|---|
ENDURING UNDERSTANDING | MOD-1 Some objects or concepts are so frequently represented that programmers can draw upon existing code that has already been tested, enabling them to write solutions more quickly and with a greater degree of confidence. | VAR-1 To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. | |
LEARNING OBJECTIVE | MOD-1.A Call System class methods to generate output to the console. | VAR-1.A Create string literals | |
ESSENTIAL KNOWLEDGE | MOD-1.A.1 System.out.print and System.out.println display information on the computer monitor. | MOD-1.A.2 System.out.println moves the cursor to a new line after the information has been displayed, while System.out.print does not. | VAR-1.A.1 A string literal is enclosed in double quotes. |
1.2 Variables and Data Types
DATES
TOPIC | 1.2 Variables and Data Types | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-1 To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. | ||||||
LEARNING OBJECTIVE | VAR-1.B Identify the most appropriate data type category for a particular specification. | VAR-1.C Declare variables of the correct types to represent primitive data. | |||||
ESSENTIAL KNOWLEDGE | VAR-1.B.1 A type is a set of values (a domain) and a set of operations on them. | VAR-1.B.2 Data types can be categorized as either primitive or reference. | VAR-1.B.3 The primitive data types used in this course define the set of operations for numbers and Boolean values. | VAR-1.C.1 The three primitive data types used in this course are int, double, and boolean. | VAR-1.C.2 Each variable has associated memory that is used to hold its value. | VAR-1.C.3 The memory associated with a variable of a primitive type holds an actual primitive value | VAR-1.C.4 When a variable is declared final, its value cannot be changed once it is initialized. |
1.3 Expressions and Assignment Statements
DATES
TOPIC | 1.3 Expressions and Assignment Statements | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | CON-1 The way variables and operators are sequenced and combined in an expression determines the computed result. | ||||||||||
LEARNING OBJECTIVE | CON-1.A Evaluate arithmetic expressions in a program code. | CON-1.A.5 An arithmetic operation that uses a double value will evaluate to a double value. | |||||||||
ESSENTIAL KNOWLEDGE | CON-1.A.1 A literal is the source code representation of a fixed value. | CON-1.A.2 Arithmetic expressions include expressions of type int and double. | CON-1.A.3 The arithmetic operators consist of +, −, *, /, and %. | CON-1.A.4 An arithmetic operation that uses two int values will evaluate to an int value. | CON-1.A.5 An arithmetic operation that uses a double value will evaluate to a double value. | CON-1.A.6 Operators can be used to construct compound expressions. | CON-1.A.7 During evaluation, operands are associated with operators according to operator precedence to determine how they are grouped. | CON-1.A.8 An attempt to divide an integer by zero will result in an ArithmeticException to occur. | CON-1.B.1 The assignment operator (=) allows a program to initialize or change the value stored in a variable. The value of the expression on the right is stored in the variable on the left. | CON-1.B.2 During execution, expressions are evaluated to produce a single value | CON-1.B.3 The value of an expression has a type based on the evaluation of the expression. |
1.4 Compound Assignment Operators
DATES
TOPIC | 1.4 Compound Assignment Operators | |
---|---|---|
ENDURING UNDERSTANDING | CON-1 The way variables and operators are sequenced and combined in an expression determines the computed result. | |
LEARNING OBJECTIVE | CON-1.B Evaluate what is stored in a variable as a result of an expression with an assignment statement. | |
ESSENTIAL KNOWLEDGE | CON-1.B.4 Compound assignment operators (+=, −=, *=, /=, %=) can be used in place of the assignment operator. | CON-1.B.5 The increment operator (++) and decrement operator (−−) are used to add 1 or subtract 1 from the stored value of a variable or an array element. The new value is assigned to the variable or array element. |
1.5 Casting and Ranges of Variables
DATES
TOPIC | 1.5 Casting and Ranges of Variables | |||||
---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | CON-1 The way variables and operators are sequenced and combined in an expression determines the computed result. | |||||
LEARNING OBJECTIVE | CON-1.C Evaluate arithmetic expressions that use casting. | |||||
ESSENTIAL KNOWLEDGE | CON-1.C.1 The casting operators (int) and (double) can be used to create a temporary value converted to a different data type. | CON-1.C.2 Casting a double value to an int causes the digits to the right of the decimal point to be truncated. | CON-1.C.3 Some programming code causes int values to be automatically cast (widened) to double values. | CON-1.C.4 Values of type double can be rounded to the nearest integer by (int)(x + 0.5) or (int)(x – 0.5) for negative numbers. | CON-1.C.5 Integer values in Java are represented by values of type int, which are stored using a finite amount (4 bytes) of memory. Therefore, an int value must be in the range from Integer.MIN_VALUE to Integer.MAX_VALUE inclusive. | CON-1.C.6 If an expression would evaluate to an int value outside of the allowed range, an integer overflow occurs. This could result in an incorrect value within the allowed range. |
Activities
Sample Activities | Error analysis Provide students with code that contains syntax errors. Ask students to identify and correct the errors in the provided code. Once they feel they have identified and corrected all syntax errors, have them verify their conclusion by using a compiler and an IDE that does not autocorrect errors. |
---|---|
Activating prior knowledge The basic arithmetic operators of +, −, /, and * are similar to what students have experienced in math class or when using a calculator. Give students a list of expressions and ask them to apply what they know from math class to evaluate the meaning of the expressions. Have them verify their results by putting them into a compiler. |
|
Sharing and responding Put student into groups of two. Provide each student with a different set of statements; in each pair, one student should have a list of statements that contain compound assignment operators, while the other student should have a list of statements that accomplish the same thing without using compound statements. Be sure the statements are in a different order. Students should take turns describing what a statement does to their partner, and the partner should determine which statement of theirs is equivalent to the one being described. |
|
Predict and compare Provide students with several statements that involve casting. Each cast should be on a different value in the statement. Have students predict the resulting value. For any statements that would not compile or work as intended, have students explain the problem and propose a solution. They should verify their results by putting those results into a compiler. |
UNIT 2: Using Objects
Overview
AP EXAM WEIGHTING | 5–7.5% |
CLASS PERIODS | ~13–15 |
OVERVIEW | In the first unit, students used primitive types to represent real-world data and determined how to use them in arithmetic expressions to solve problems. This unit introduces a new type of data: reference data. Reference data allows real-world objects to be represented in varying degrees specific to a programmer's purpose. This unit builds on students' ability to write expressions by introducing them to Math class methods to write expressions for generating random numbers and other more complex operations. In addition, strings and the existing methods within the String class are an important topic within this unit. Knowing how to declare variables or call methods on objects is necessary throughout the course but will be very important in Units 5 and 9 when teaching students how to write their own classes and about inheritance relationships. |
2.1 Objects: Instances of Classes
DATES
TOPIC | 2.1 Objects: Instances of Classes | |
---|---|---|
ENDURING UNDERSTANDING | MOD-1 Some objects or concepts are so frequently represented that programmers can draw upon existing code that has already been tested, enabling them to write solutions more quickly and with a greater degree of confidence. | |
LEARNING OBJECTIVE | MOD-1.B Explain the relationship between a class and an object. | |
ESSENTIAL KNOWLEDGE | MOD-1.B.1 An object is a specific instance of a class with defined attributes. | MOD-1.B.2 A class is the formal implementation, or blueprint, of the attributes and behaviors of an object. |
2.2 Creating and Storing Objects (Instantiation)
DATES
TOPIC | 2.2 Creating and Storing Objects (Instantiation) | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-1 Some objects or concepts are so frequently represented that programmers can draw upon existing code that has already been tested, enabling them to write solutions more quickly and with a greater degree of confidence. | VAR-1 To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. | ||||||||||
LEARNING OBJECTIVE | MOD-1.C Identify, using its signature, the correct constructor being called. | MOD-1.D For creating objects: a. Create objects by calling constructors without parameters. b. Create objects by calling constructors with parameters. | VAR-1.D Define variables of the correct types to represent reference data. | |||||||||
ESSENTIAL KNOWLEDGE | MOD-1.C.1 A signature consists of the constructor name and the parameter list. | MOD-1.C.2 The parameter list, in the header of a constructor, lists the types of the values that are passed and their variable names. These are often referred to as formal parameters. | MOD-1.C.3 A parameter is a value that is passed into a constructor. These are often referred to as actual parameters. | MOD-1.C.4 Constructors are said to be overloaded when there are multiple constructors with the same name but a different signature. | MOD-1.C.5 The actual parameters passed to a constructor must be compatible with the types identified in the formal parameter list. | MOD-1.C.6 Parameters are passed using call by value. Call by value initializes the formal parameters with copies of the actual parameters. | MOD-1.D For creating objects: a. Create objects by calling constructors without parameters. b. Create objects by calling constructors with parameters. | MOD-1.D.2 A class contains constructors that are invoked to create objects. They have the same name as the class. | MOD-1.D.3 Existing classes and class libraries can be utilized as appropriate to create objects. | MOD-1.D.4 Parameters allow values to be passed to the constructor to establish the initial state of the object. | VAR-1.D.1 The keyword null is a special value used to indicate that a reference is not associated with any object. | VAR-1.D.2 The memory associated with a variable of a reference type holds an object reference value or, if there is no object, null. This value is the memory address of the referenced object. |
2.3 Calling a Void Method
DATES
TOPIC | 2.3 Calling a Void Method | |||||||
---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-1 Some objects or concepts are so frequently represented that programmers can draw upon existing code that has already been tested, enabling them to write solutions more quickly and with a greater degree of confidence. | |||||||
LEARNING OBJECTIVE | MOD-1.E Call non-static void methods without parameters. | |||||||
ESSENTIAL KNOWLEDGE | MOD-1.E.1 An object’s behavior refers to what the object can do (or what can be done to it) and is defined by methods. | MOD-1.E.2 Procedural abstraction allows a programmer to use a method by knowing what the method does even if they do not know how the method was written. | MOD-1.E.3 A method signature for a method without parameters consists of the method name and an empty parameter list. | MOD-1.E.4 A method or constructor call interrupts the sequential execution of statements, causing the program to first execute the statements in the method or constructor before continuing. Once the last statement in the method or constructor has executed or a return statement is executed, flow of control is returned to the point immediately following where the method or constructor was called. | MOD-1.E.5 Non-static methods are called through objects of the class. | MOD-1.E.6 The dot operator is used along with the object name to call non-static methods. | MOD-1.E.7 Void methods do not have return values and are therefore not called as part of an expression. | MOD-1.E.8 Using a null reference to call a method or access an instance variable causes a NullPointerException to be thrown. |
2.4 Calling a Void Method with Parameters
DATES
TOPIC | 2.4 Calling a Void Method with Parameters | ||
---|---|---|---|
ENDURING UNDERSTANDING | MOD-1 Some objects or concepts are so frequently represented that programmers can draw upon existing code that has already been tested, enabling them to write solutions more quickly and with a greater degree of confidence. | ||
LEARNING OBJECTIVE | MOD-1.F Call non-static void methods with parameters. | ||
ESSENTIAL KNOWLEDGE | MOD-1.F.1 A method signature for a method with parameters consists of the method name and the ordered list of parameter types. | MOD-1.F.2 Values provided in the parameter list need to correspond to the order and type in the method signature. | MOD-1.F.3 Methods are said to be overloaded when there are multiple methods with the same name but a different signature. |
2.5 Calling a Non-void Method
DATES
TOPIC | 2.5 Calling a Non-void Method |
---|---|
ENDURING UNDERSTANDING | MOD-1 Some objects or concepts are so frequently represented that programmers can draw upon existing code that has already been tested, enabling them to write solutions more quickly and with a greater degree of confidence. |
LEARNING OBJECTIVE | MOD-1.G Call non-static non-void methods with or without parameters. |
ESSENTIAL KNOWLEDGE | MOD-1.G.1 Non-void methods return a value that is the same type as the return type in the signature. To use the return value when calling a non-void method, it must be stored in a variable or used as part of an expression. |
2.6 String Objects: Concatenation, Literals, and More
DATES
TOPIC | 2.6 String Objects: Concatenation, Literals, and More | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-1 To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. | ||||
LEARNING OBJECTIVE | VAR-1.E For String class: a. Create String objects. b. Call String methods. | ||||
ESSENTIAL KNOWLEDGE | VAR-1.E.1 String objects can be created by using string literals or by calling the String class constructor | VAR-1.E.2 String objects are immutable, meaning that String methods do not change the String object. | VAR-1.E.3 String objects can be concatenated using the + or += operator, resulting in a new String object. | VAR-1.E.4 Primitive values can be concatenated with a String object. This causes implicit conversion of the values to String objects. | VAR-1.E.5 Escape sequences start with a \ and have a special meaning in Java. Escape sequences used in this course include \”, \\, and \n. |
2.7 String Methods
DATES
TOPIC | 2.7 String Methods | |||||||
---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-1 To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. | |||||||
LEARNING OBJECTIVE | VAR-1.E For String class: a. Create String objects. b. Call String methods. | |||||||
ESSENTIAL KNOWLEDGE | VAR-1.E.6 Application program interfaces (APIs) and libraries simplify complex programming tasks. | VAR-1.E.7 Documentation for APIs and libraries are essential to understanding the attributes and behaviors of an object of a class. | VAR-1.E.8 Classes in the APIs and libraries are grouped into packages. | VAR-1.E.9 The String class is part of the java.lang package. Classes in the java.lang package are available by default. | VAR-1.E.10 A String object has index values from 0 to length – 1. Attempting to access indices outside this range will result in an IndexOutOfBoundsException. | VAR-1.E.11 A String object can be concatenated with an object reference, which implicitly calls the referenced object’s toString method. | VAR-1.E.12 The following String methods and constructors—including what they do and when they are used—are part of the Java Quick Reference: § String(String str) — Constructs a new String object that represents the same sequence of characters as str § int length() — Returns the number of characters in a String object § String substring (int from, int to) returns stubstring starting at from ending at to -1 § String substring(int from) — Returns substring(from, length()) § int indexOf(String str) — Returns the index of the first occurrence of str; returns -1 if not found § boolean equals(String other) — Returns true if this is equal to other; returns false otherwise § int compareTo(String other) — Returns a value < 0 if this is less than other; returns zero if this is equal to other; returns a value > 0 if this is greater than other | VAR-1.E.13 A string identical to the single element substring at position index can be created by calling substring(index, index + 1) |
Activities
Sample Activities | Using manipulatives When introducing students to the idea of creating objects, you can use a cookie cutter and modeling clay or dough, with the cutter representing the class and the cut dough representing the objects. For each object cut, write the instantiation. Ask students to describe what the code is doing and how the different parameter values (e.g., thickness, color) change the object that was created. |
---|---|
Marking the text Provide students with several statements that define a variable and create an object on a single line. Have students mark up the statements by circling the assignment operator and the new keyword. Then, have students underline the variable type and the constructor. Lastly, have them draw a rectangle around the list of actual parameters being passed to the constructor. Using these marked-up statements, ask students to create several new variables and objects. |
|
Think-pair-share Provide students with several code segments, each with a missing expression that would contain a call to a method in the Math class, and a description of the intended outcome of each code segment. Ask them which statement should be used to complete the code segment. Have them share their responses with a partner to compare answers and come to agreement, and then have groups share with the entire class. |
UNIT 3: Boolean Expressions and if Statements
Overview
AP EXAM WEIGHTING | 15–17.5% |
CLASS PERIODS | ~11–13 |
OVERVIEW | Algorithms are composed of three building blocks: sequencing, selection, and iteration. This unit focuses on selection, which is represented in a program by using conditional statements. Conditional statements give the program the ability to decide and respond appropriately and are a critical aspect of any nontrivial computer program. In addition to learning the syntax and proper use of conditional statements, students will build on the introduction of Boolean variables by writing Boolean expressions with relational and logical operators. The third building block of all algorithms is iteration, which you will cover in Unit 4. Selection and iteration work together to solve problems. |
3.1 Boolean Expressions
DATES
TOPIC | 3.1 Boolean Expressions | ||
---|---|---|---|
ENDURING UNDERSTANDING | CON-1 The way variables and operators are sequenced and combined in an expression determines the computed result. | ||
LEARNING OBJECTIVE | CON-1.E Evaluate Boolean expressions that use relational operators in program code. | ||
ESSENTIAL KNOWLEDGE | CON-1.E.1 Primitive values and reference values can be compared using relational operators (i.e., == and !=). | CON-1.E.2 Arithmetic expression values can be compared using relational operators (i.e., <, >, <=, >=). | CON-1.E.3 An expression involving relational operators evaluates to a Boolean value. |
3.2 if Statements and Control Flow
DATES
TOPIC | 3.2 if Statements and Control Flow | ||
---|---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | ||
LEARNING OBJECTIVE | CON-2.A Represent branching logical processes by using conditional statements. | ||
ESSENTIAL KNOWLEDGE | CON-2.A.1 Conditional statements interrupt the sequential execution of statements. | CON-2.A.2 if statements affect the flow of control by executing different statements based on the value of a Boolean expression. | CON-2.A.3 A one-way selection (if statement) is written when there is a set of statements to execute under a certain condition. In this case, the body is executed only when the Boolean condition is true. |
3.3 if-else Statements
DATES
TOPIC | 3.3 if-else Statements |
---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. |
LEARNING OBJECTIVE | CON-2.A Represent branching logical processes by using conditional statements. |
ESSENTIAL KNOWLEDGE | CON-2.A.4 A two-way selection is written when there are two sets of statements— one to be executed when the Boolean condition is true, and another set for when the Boolean condition is false. In this case, the body of the “if” is executed when the Boolean condition is true, and the body of the “else” is executed when the Boolean condition is false. |
3.4 else if Statements
DATES
TOPIC | 3.4 else if Statements |
---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. |
LEARNING OBJECTIVE | CON-2.A Represent branching logical processes by using conditional statements. |
ESSENTIAL KNOWLEDGE | CON-2.A.5 A multi-way selection is written when there are a series of conditions with different statements for each condition. Multi-way selection is performed using if-else-if statements such that exactly one section of code is executed based on the first condition that evaluates to true. |
3.5 Compound Boolean Expressions
DATES
TOPIC | 3.5 Compound Boolean Expressions | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | CON-1 The way variables and operators are sequenced and combined in an expression determines the computed result. | ||
LEARNING OBJECTIVE | CON-2.B Represent branching logical processes by using nested conditional statements. | CON-1.F Evaluate compound Boolean expressions in program code. | ||
ESSENTIAL KNOWLEDGE | CON-2.B.1 Nested if statements consist of if statements within if statements. | CON-1.F.1 Logical operators !(not), &&(and), and ||(or) are used with Boolean values. This represents the order these operators will be evaluated. | CON-1.F.2 An expression involving logical operators evaluates to a Boolean value. | CON-1.F.3 When the result of a logical expression using && or || can be determined by evaluating only the first Boolean operand, the second is not evaluated. This is known as short-circuited evaluation. |
3.6 Equivalent Boolean Expressions
DATES
TOPIC | 3.6 Equivalent Boolean Expressions | ||
---|---|---|---|
ENDURING UNDERSTANDING | CON-1 The way variables and operators are sequenced and combined in an expression determines the computed result. | ||
LEARNING OBJECTIVE | CON-1.G Compare and contrast equivalent Boolean expressions. | ||
ESSENTIAL KNOWLEDGE | CON-1.G.1 De Morgan’s Laws can be applied to Boolean expressions. | CON-1.G.2 Truth tables can be used to prove Boolean identities. | CON-1.G.3 Equivalent Boolean expressions will evaluate to the same value in all cases. |
3.7 Comparing Objects
DATES
TOPIC | 3.7 Comparing Objects | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | CON-1 The way variables and operators are sequenced and combined in an expression determines the computed result. | |||
LEARNING OBJECTIVE | CON-1.H Compare object references using Boolean expressions in program code. | |||
ESSENTIAL KNOWLEDGE | CON-1.H.1 Two object references are considered aliases when they both reference the same object. | CON-1.H.2 Object reference values can be compared, using == and !=, to identify aliases. | CON-1.H.3 A reference value can be compared with null, using == or !=, to determine if the reference actually references an object. | CON-1.H.4 Often classes have their own equals method, which can be used to determine whether two objects of the class are equivalent. |
Activities
Sample Activities | Code tracing Provide students with several code segments that contain conditional statements. Have students trace various sample inputs, keeping track of the statements that get executed and the order in which they are executed. This can help students find errors and validate results. |
---|---|
Pair programming Have students work with a partner to create a “guess checker” that could be used as part of a larger game. Students compare four given digits to a preexisting four-digit code that is stored in individual variables. Their program should provide output containing the number of correct digits in correct locations, as well as the number of correct digits in incorrect locations. This program can be continually improved as students learn about nested conditional statements and compound Boolean expressions. |
|
Diagramming Have students create truth tables by listing all the possible true and false combinations and corresponding Boolean values for a given compound Boolean expression. Once students have created the truth table, provide students with input values. Have students determine the value of each individual Boolean expression and use the truth table to determine the result of the compound Boolean expression. |
|
Student response system Provide students with a code segment that utilizes conditional statements and a compound Boolean expression, and ask them to choose an equivalent code segment that uses a nested conditional statement (and vice versa). Have them report their responses using a student response system. |
|
Predict and compare Have students predict the output of several different code segments that compare object references—some that use .equals() and some that use ==. Once done, have them create a program that contains those code segments and compare the actual and expected results. This is best illustrated using a simple class that you write yourself. |
UNIT 4: Iteration
Overview
AP EXAM WEIGHTING | 17.5–22.5% |
CLASS PERIODS | ~14–16 |
OVERVIEW | This unit focuses on iteration using while and for loops. As you saw in Unit 3, Boolean expressions are useful when a program needs to perform different operations under different conditions. Boolean expressions are also one of the main components in iteration. This unit introduces several standard algorithms that use iteration. Knowledge of standard algorithms makes solving similar problems easier, as algorithms can be modified or combined to suit new situations. Iteration is used when traversing data structures such as arrays, ArrayLists, and 2D arrays. In addition, it is a necessary component of several standard algorithms, including searching and sorting, which will be covered in later units. |
4.1 while Loops
DATES
TOPIC | 4.1 while Loops | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | ||||||
LEARNING OBJECTIVE | CON-2.C Represent iterative processes using a while loop. | CON-2.D For algorithms in the context of a particular specification that does not require the use of traversals: § Identify standard algorithms. § Modify standard algorithms. § Develop an algorithm. | |||||
ESSENTIAL KNOWLEDGE | CON-2.C.1 Iteration statements change the flow of control by repeating a set of statements zero or more times until a condition is met. | CON-2.C.2 In loops, the Boolean expression is evaluated before each iteration of the loop body, including the first. When the expression evaluates to true, the loop body is executed. This continues until the expression evaluates to false, whereupon the iteration ceases. | CON-2.C.3 A loop is an infinite loop when the Boolean expression always evaluates to true. | CON-2.C.4 If the Boolean expression evaluates to false initially, the loop body is not executed at all. | CON-2.C.5 Executing a return statement inside an iteration statement will halt the loop and exit the method or constructor. | CON-2.D.1 There are standard algorithms to: § Identify if an integer is or is not evenly divisible by another integer § Identify the individual digits in an integer § Determine the frequency with which a specific criterion is met | CON-2.D.2 There are standard algorithms to: § Determine a minimum or maximum value § Compute a sum, average, or mode |
4.2 for Loops
DATES
TOPIC | 4.2 for Loops |
||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. |
||||
LEARNING OBJECTIVE | CON-2.E Represent iterative processes using a for loop. |
||||
ESSENTIAL KNOWLEDGE | CON-2.E.1 There are three parts in a for loop header: the initialization, the Boolean expression, and the increment. The increment statement can also be a decrement statement. |
CON-2.E.2 In a for loop, the initialization statement is only executed once before the first Boolean expression evaluation. The variable being initialized is referred to as a loop control variable. |
CON-2.E.3 In each iteration of a for loop, the increment statement is executed after the entire loop body is executed and before the Boolean expression is evaluated again. |
CON-2.E.4 A for loop can be rewritten into an equivalent while loop and vice versa. |
CON-2.E.5 “Off by one” errors occur when the iteration statement loops one time too many or one time too few. |
4.3 Developing Algorithms Using Strings
DATES
TOPIC | 4.3 Developing Algorithms Using Strings |
---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. |
LEARNING OBJECTIVE | CON-2.F For algorithms in the context of a particular specification that involves String objects: § Identify standard algorithms. § Modify standard algorithms. § Develop an algorithm. |
ESSENTIAL KNOWLEDGE | CON-2.F.1 There are standard algorithms that utilize String traversals to: § Find if one or more substrings has a particular property § Determine the number of substrings that meet specific criteria § Create a new string with the characters reversed |
4.4 Nested Iteration
DATES
TOPIC | 4.4 Nested Iteration |
|
---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. |
|
LEARNING OBJECTIVE | CON-2.G Represent nested iterative processes. |
|
ESSENTIAL KNOWLEDGE | CON-2.G.1 Nested iteration statements are iteration statements that appear in the body of another iteration statement. |
CON-2.G.2 When a loop is nested inside another loop, the inner loop must complete all its iterations before the outer loop can continue. |
4.5 Informal Code Analysis
DATES
TOPIC | 4.5 Informal Code Analysis |
---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. |
LEARNING OBJECTIVE | CON-2.H Compute statement execution counts and informal run-time comparison of iterative statements. |
ESSENTIAL KNOWLEDGE | CON-2.H.1 A statement execution count indicates the number of times a statement is executed by the program. |
Activities
Sample Activities | Jigsaw As a whole class, look at a code segment containing iteration and the resulting output. Afterward, divide students into groups, and provide each group with a slightly modified code segment. After groups have determined how the result changes based on their modified segment, have them get together with students who investigated a different version of the code segment and share their conclusions. |
---|---|
Note-taking Provide students with a method that, when given an integer, returns the month name from a String that includes all the month names in order, each separated by a space. Have them annotate what each statement does in the method. Then, ask students to use their annotated method as a guide to write a similar method that, given a student number as input, returns the name of a student from a String containing the first name of all students in the class, each separated by a space. |
|
Simplify the problem Provide students with several code segments containing iteration. For each segment, have students trace through the execution of a loop with smaller bounds to see what boundary cases are considered, and then use that information to determine the number of times each loop executes with the original bounds. |
UNIT 5: Writing Classes
AP EXAM WEIGHTING | 5–7.5% |
CLASS PERIODS | ~12–14 |
OVERVIEW | This unit will pull together information from all previous units to create new, user-defined reference data types in the form of classes. The ability to accurately model real-world entities in a computer program is a large part of what makes computer science so powerful. This unit focuses on identifying appropriate behaviors and attributes of real-world entities and organizing these into classes. Students will build on what they learn in this unit to represent relationships between classes through hierarchies, which appear in Unit 9. The creation of computer programs can have extensive impacts on societies, economies, and cultures. The legal and ethical concerns that come with programs and the responsibilities of programmers are also addressed in this unit. |
5.1 Anatomy of a Class
DATES
TOPIC | 5.1 Anatomy of a Class | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-2 Programmers use code to represent a physical object or nonphysical concept, real or imagined, by defining a class based on the attributes and/or behaviors of the object or concept. | MOD-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. | ||||||||
LEARNING OBJECTIVE | MOD-2.A Designate access and visibility constraints to classes, data, constructors, and methods. | MOD-3.A Designate private visibility of instance variables to encapsulate the attributes of an object. | ||||||||
ESSENTIAL KNOWLEDGE | MOD-2.A.1 The keywords public and private affect the access of classes, data, constructors, and methods. | MOD-2.A.2 The keyword private restricts access to the declaring class, while the keyword public allows access from classes outside the declaring class. | MOD-2.A.3 Classes are designated public. | MOD-2.A.4 Access to attributes should be kept internal to the class. Therefore, instance variables are designated as private. | MOD-2.A.5 Constructors are designated public. | MOD-2.A.6 Access to behaviors can be internal or external to the class. Therefore, methods can be designated as either public or private. | MOD-3.A.1 Data encapsulation is a technique in which the implementation details of a class are kept hidden from the user. | MOD-3.A.2 When designing a class, programmers make decisions about what data to make accessible and modifiable from an external class. Data can be either accessible or modifiable, or it can be both or neither. | MOD-3.A.3 Instance variables are encapsulated by using the private access modifier. | MOD-3.A.4 The provided accessor and mutator methods in a class allow client code to use and modify data. |
5.2 Constructors
DATES
TOPIC | 5.2 Constructors | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-2 Programmers use code to represent a physical object or nonphysical concept, real or imagined, by defining a class based on the attributes and/or behaviors of the object or concept. | ||||
LEARNING OBJECTIVE | MOD-2.B Define instance variables for the attributes to be initialized through the constructors of a class. | ||||
ESSENTIAL KNOWLEDGE | MOD-2.B.1 An object’s state refers to its attributes and their values at a given time and is defined by instance variables belonging to the object. This creates a “has-a” relationship between the object and its instance variables. | MOD-2.B.2 Constructors are used to set the initial state of an object, which should include initial values for all instance variables. | MOD-2.B.3 Constructor parameters are local variables to the constructor and provide data to initialize instance variables. | MOD-2.B.4 When a mutable object is a constructor parameter, the instance variable should be initialized with a copy of the referenced object. In this way, the instance variable is not an alias of the original object, and methods are prevented from modifying the state of the original object. | MOD-2.B.5 When no constructor is written, Java provides a no-argument constructor, and the instance variables are set to default values. |
5.3 Documentation with Comments
DATES
TOPIC | 5.3 Documentation with Comments | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-2 Programmers use code to represent a physical object or nonphysical concept, real or imagined, by defining a class based on the attributes and/or behaviors of the object or concept. | ||||
LEARNING OBJECTIVE | MOD-2.C Describe the functionality and use of program code through comments. | ||||
ESSENTIAL KNOWLEDGE | MOD-2.C.1 Comments are ignored by the compiler and are not executed when the program is run. | MOD-2.C.2 Three types of comments in Java include /* */, which generates a block of comments, //, which generates a comment on one line, and /** */, which are Javadoc comments and are used to create API documentation. | MOD-2.C.3 A precondition is a condition that must be true just prior to the execution of a section of program code in order for the method to behave as expected. There is no expectation that the method will check to ensure preconditions are satisfied. | MOD-2.C.4 A postcondition is a condition that must always be true after the execution of a section of program code. Postconditions describe the outcome of the execution in terms of what is being returned or the state of an object. | MOD-2.C.5 Programmers write method code to satisfy the postconditions when preconditions are met. |
5.4 Accessor Methods
DATES
TOPIC | 5.4 Accessor Methods | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-2 Programmers use code to represent a physical object or nonphysical concept, real or imagined, by defining a class based on the attributes and/or behaviors of the object or concept. | ||||||
LEARNING OBJECTIVE | MOD-2.D Define behaviors of an object through non-void methods without parameters written in a class. | ||||||
ESSENTIAL KNOWLEDGE | MOD-2.D.1 An accessor method allows other objects to obtain the value of instance variables or static variables. | MOD-2.D.2 A non-void method returns a single value. Its header includes the return type in place of the keyword void. | MOD-2.D.3 In non-void methods, a return expression compatible with the return type is evaluated, and a copy of that value is returned. This is referred to as “return by value.” | MOD-2.D.4 When the return expression is a reference to an object, a copy of that reference is returned, not a copy of the object. | MOD-2.D.5 The return keyword is used to return the flow of control to the point immediately following where the method or constructor was called. | MOD-2.D.6 The toString method is an overridden method that is included in classes to provide a description of a specific object. It generally includes what values are stored in the instance data of the object. | MOD-2.D.7 If System.out.print or System.out. println is passed an object, that object’s toString method is called, and the returned string is printed. |
5.5 Mutator Methods
DATES
TOPIC | 5.5 Mutator Methods | |
---|---|---|
ENDURING UNDERSTANDING | MOD-2 Programmers use code to represent a physical object or nonphysical concept, real or imagined, by defining a class based on the attributes and/or behaviors of the object or concept. | |
LEARNING OBJECTIVE | MOD-2.E Define behaviors of an object through void methods with or without parameters written in a class. | |
ESSENTIAL KNOWLEDGE | MOD-2.E.1 A void method does not return a value. Its header contains the keyword void before the method name. | MOD-2.E.2 A mutator (modifier) method is often a void method that changes the values of instance variables or static variables. |
5.6 Writing Methods
DATES
TOPIC | 5.6 Writing Methods | |||||
---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-2 Programmers use code to represent a physical object or nonphysical concept, real or imagined, by defining a class based on the attributes and/or behaviors of the object or concept. | |||||
LEARNING OBJECTIVE | MOD-2.F Define behaviors of an object through non-void methods with parameters written in a class. | |||||
ESSENTIAL KNOWLEDGE | MOD-2.F.1 Methods can only access the private data and methods of a parameter that is a reference to an object when the parameter is the same type as the method’s enclosing class. | MOD-2.F.2 Non-void methods with parameters receive values through parameters, use those values, and return a computed value of the specified type. | MOD-2.F.3 It is good programming practice to not modify mutable objects that are passed as parameters unless required in the specification. | MOD-2.F.4 When an actual parameter is a primitive value, the formal parameter is initialized with a copy of that value. Changes to the formal parameter have no effect on the corresponding actual parameter. | MOD-2.F.5 When an actual parameter is a reference to an object, the formal parameter is initialized with a copy of that reference, not a copy of the object. If the reference is to a mutable object, the method or constructor can use this reference to alter the state of the object. | MOD-2.F.6 Passing a reference parameter results in the formal parameter and the actual parameter being aliases. They both refer to the same object. |
5.7 Static Variables and Methods
DATES
TOPIC | 5.7 Static Variables and Methods | |||||||
---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-2 Programmers use code to represent a physical object or nonphysical concept, real or imagined, by defining a class based on the attributes and/or behaviors of the object or concept. | |||||||
LEARNING OBJECTIVE | MOD-2.G Define behaviors of a class through static methods. | MOD-2.H Define the static variables that belong to the class. | ||||||
ESSENTIAL KNOWLEDGE | MOD-2.G.1 Static methods are associated with the class, not objects of the class. | MOD-2.G.2 Static methods include the keyword static in the header before the method name. | MOD-2.G.3 Static methods cannot access or change the values of instance variables. | MOD-2.G.4 Static methods can access or change the values of static variables. | MOD-2.G.5 Static methods do not have a this reference and are unable to use the class’s instance variables or call non-static methods. | MOD-2.H.1 Static variables belong to the class, with all objects of a class sharing a single static variable. | MOD-2.H.2 Static variables can be designated as either public or private and are designated with the static keyword before the variable type. | MOD-2.H.3 Static variables are used with the class name and the dot operator, since they are associated with a class, not objects of a class. |
5.8 Scope and Access
DATES
TOPIC | 5.8 Scope and Access | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-1 To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. | |||
LEARNING OBJECTIVE | VAR-1.G Explain where variables can be used in the program code. | |||
ESSENTIAL KNOWLEDGE | VAR-1.G.1 Local variables can be declared in the body of constructors and methods. These variables may only be used within the constructor or method and cannot be declared to be public or private. | VAR-1.G.2 When there is a local variable with the same name as an instance variable, the variable name will refer to the local variable instead of the instance variable. | VAR-1.G.3 Formal parameters and variables declared in a method or constructor can only be used within that method or constructor. | VAR-1.G.4 Through method decomposition, a programmer breaks down a large problem into smaller subproblems by creating methods to solve each individual subproblem. |
5.9 this Keyword
DATES
TOPIC | 5.9 this Keyword | |
---|---|---|
ENDURING UNDERSTANDING | VAR-1 To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. | |
LEARNING OBJECTIVE | VAR-1.H Evaluate object reference expressions that use the keyword this. | |
ESSENTIAL KNOWLEDGE | VAR-1.H.1 Within a non-static method or a constructor, the keyword this is a reference to the current object—the object whose method or constructor is being called. | VAR-1.H.2 The keyword this can be used to pass the current object as an actual parameter in a method call. |
5.10 Ethical and Social Implications of Computing Systems
DATES
TOPIC | 5.10 Ethical and Social Implications of Computing Systems | ||
---|---|---|---|
ENDURING UNDERSTANDING | IOC-1 While programs are typically designed to achieve a specific purpose, they may have unintended consequences. | ||
LEARNING OBJECTIVE | IOC-1.A Explain the ethical and social implications of computing systems. | ||
ESSENTIAL KNOWLEDGE | IOC-1.A.1 System reliability is limited. Programmers should make an effort to maximize system reliability. | IOC-1.A.2 Legal issues and intellectual property concerns arise when creating programs. | IOC-1.A.3 The creation of programs has impacts on society, economies, and culture. These impacts can be beneficial and/or harmful. |
Activities
Sample Activities | Kinesthetic learning Have students break into groups of 4–5 to play board games. Ask them to play the game for about 10 minutes. While they play the game, they should keep track of the various nouns they encounter and actions that happen as part of the game. The nouns can be represented in the computer as classes, and the actions are the behaviors. At the end of game play, ask students to create UML diagrams for the identified classes. |
---|---|
Marking the text Present students with specifications, and have them highlight or underline any preconditions (both implicit and explicit) that exist for the method to function. This includes information about parameters, such as object references not being null. |
|
Create a plan When asked to write a method, have students write an outline using pseudocode with paper and pencil. Then, go through it step-by-step with sample input to ensure that the process is correct and to determine if any additional information is needed before beginning to program a solution on the computer. |
|
Paraphrase Provide students with several example classes that utilize static variables for unique identification numbers or for counting the number of objects that have been created, but do not provide any description or documentation for the code. Have students spend time creating objects and calling the static methods to investigate how the static variables behave, then have them document the code appropriately to describe how each class utilizes static variables and methods. |
UNIT 6: Array
Overview
AP EXAM WEIGHTING | 10–15% |
CLASS PERIODS | ~6–8 |
OVERVIEW | This unit focuses on data structures, which are used to represent collections of related data using a single variable rather than multiple variables. Using a data structure along with iterative statements with appropriate bounds will allow for similar treatment to be applied more easily to all values in the collection. Just as there are useful standard algorithms when dealing with primitive data, there are standard algorithms to use with data structures. In this unit, we apply standard algorithms to arrays; however, these same algorithms are used with ArrayLists and 2D arrays as well. Additional standard algorithms, such as standard searching and sorting algorithms, will be covered in the next unit. |
6.1 Array Creation and Access
DATES
TOPIC | 6.1 Array Creation and Access | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. | ||||||
LEARNING OBJECTIVE | VAR-2.A Represent collections of related primitive or object reference data using onedimensional (1D) array objects. | ||||||
ESSENTIAL KNOWLEDGE | VAR-2.A.1 The use of array objects allows multiple related items to be represented using a single variable. | VAR-2.A.2 The size of an array is established at the time of creation and cannot be changed. | VAR-2.A.3 Arrays can store either primitive data or object reference data. | VAR-2.A.4 When an array is created using the keyword new, all of its elements are initialized with a specific value based on the type of elements: § Elements of type int are initialized to 0 § Elements of type double are initialized to 0.0 § Elements of type boolean are initialized to false § Elements of a reference type are initialized to the reference value null. No objects are automatically created | VAR-2.A.5 Initializer lists can be used to create and initialize arrays. | VAR-2.A.6 Square brackets ([ ]) are used to access and modify an element in a 1D array using an index. | VAR-2.A.7 The valid index values for an array are 0 through one less than the number of elements in the array, inclusive. Using an index value outside of this range will result in an ArrayIndexOutOfBoundsException being thrown. |
6.2 Traversing Arrays
DATES
TOPIC | 6.2 Traversing Arrays | ||
---|---|---|---|
ENDURING UNDERSTANDING | VAR-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. | ||
LEARNING OBJECTIVE | VAR-2.B Traverse the elements in a 1D array | ||
ESSENTIAL KNOWLEDGE | VAR-2.B.1 Iteration statements can be used to access all the elements in an array. This is called traversing the array | VAR-2.B.2 Traversing an array with an indexed for loop or while loop requires elements to be accessed using their indices. | VAR-2.B.3 Since the indices for an array start at 0 and end at the number of elements − 1, “off by one” errors are easy to make when traversing an array, resulting in an ArrayIndexOutOfBoundsException being thrown. |
6.3 Enhanced for Loop for Arrays
DATES
TOPIC | 6.3 Enhanced for Loop for Arrays | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. | |||
LEARNING OBJECTIVE | VAR-2.C Traverse the elements in a 1D array object using an enhanced for loop. | |||
ESSENTIAL KNOWLEDGE | VAR-2.C.1 An enhanced for loop header includes a variable, referred to as the enhanced for loop variable. | VAR-2.C.2 For each iteration of the enhanced for loop, the enhanced for loop variable is assigned a copy of an element without using its index. | VAR-2.C.3 Assigning a new value to the enhanced for loop variable does not change the value stored in the array. | VAR-2.C.4 Program code written using an enhanced for loop to traverse and access elements in an array can be rewritten using an indexed for loop or a while loop. |
6.4 Developing Algorithms Using Arrays
DATES
TOPIC | 6.4 Developing Algorithms Using Arrays | |
---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | |
LEARNING OBJECTIVE | CON-2.I For algorithms in the context of a particular specification that requires the use of array traversals: § Identify standard algorithms. § Modify standard algorithms. § Develop an algorithm. | |
ESSENTIAL KNOWLEDGE | CON-2.I.1 There are standard algorithms that utilize array traversals to: § Determine a minimum or maximum value § Compute a sum, average, or mode § Determine if at least one element has a particular property § Determine if all elements have a particular property § Access all consecutive pairs of elements § Determine the presence or absence of duplicate elements § Determine the number of elements meeting specific criteria | CON-2.I.2 There are standard array algorithms that utilize traversals to: § Shift or rotate elements left or right § Reverse the order of the elements |
Activities
Sample Activities | Diagramming Provide students with several prompts to create and access elements in an array. After they have determined the code for each prompt, have students draw a memory diagram that shows references and the arrays they point to. Have students update the diagram with each statement to demonstrate how changing the contents through one array reference effects all the array references for this array. |
---|---|
Error analysis Provide students with several error-ridden code segments containing array traversals along with the expected output of each segment. Ask them to identify any errors that they see on paper and to suggest fixes to provide the expected output. Have them type up their solutions in an IDE to verify their work. |
|
Think-pair-share Ask students to consider two program code segments that are meant to yield the same result: one using a traditional for loop and one using a for each loop. Have them take a few minutes to think independently about whether the two segments accomplish the same result and, if not, what changes could be made in order for that to happen. Then, ask students to work with their partners to come up with situations where it would make sense to use one type of loop over the other before sharing with the whole class. |
|
Pair programming Have students use pair programming to solve an array-based free-response question. Have one student be the driver for Part A while the other navigates, then have them switch for Part B. Once they are done, have partners switch solutions with another group and work through the scoring guidelines to “grade” that solution. Spend time as a class discussing the different approaches students used. |
UNIT 7: ArrayList
Overview
AP EXAM WEIGHTING | 2.5–7.5% |
CLASS PERIODS | ~10–12 |
OVERVIEW | As students learned in Unit 6, data structures are helpful when storing multiple related data values. Arrays have a static size, which causes limitations related to the number of elements stored, and it can be challenging to reorder elements stored in arrays. The ArrayList object has a dynamic size, and the class contains methods for insertion and deletion of elements, making reordering and shifting items easier. Deciding which data structure to select becomes increasingly important as the size of the data set grows, such as when using a large real-world data set. In this unit, students will also learn about privacy concerns related to storing large amounts of personal data and about what can happen if such information is compromised. |
7.1 Introduction to ArrayList
DATES
TOPIC | 7.1 Introduction to ArrayList | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. | ||||
LEARNING OBJECTIVE | VAR-2.D Represent collections of related object reference data using ArrayList objects. | ||||
ESSENTIAL KNOWLEDGE | VAR-2.D.1 An ArrayList object is mutable and contains object references. | VAR-2.D.2 The ArrayList constructor ArrayList() constructs an empty list. | VAR-2.D.3 Java allows the generic type ArrayList<E>, where the generic type E specifies the type of the elements. | VAR-2.D.4 When ArrayList<E> is specified, the types of the reference parameters and return type when using the methods are type E. | VAR-2.D.5 ArrayList<E> is preferred over ArrayList because it allows the compiler to find errors that would otherwise be found at run-time. |
7.2 ArrayList Methods
DATES
TOPIC | 7.2 ArrayList Methods | |
---|---|---|
ENDURING UNDERSTANDING | VAR-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. | |
LEARNING OBJECTIVE | VAR-2.D Represent collections of related object reference data using ArrayList objects. | |
ESSENTIAL KNOWLEDGE | VAR-2.D.6 The ArrayList class is part of the java. util package. An import statement can be used to make this class available for use in the program. | VAR-2.D.7 The following ArrayList methods— including what they do and when they are used—are part of the Java Quick Reference: § int size() - Returns the number of elements in the list § boolean add(E obj) - Appends obj to end of list; returns true § void add(int index, E obj) - Inserts obj at position index (0 <= index <= size), moving elements at position index and higher to the right (adds 1 to their indices) and adds 1 to size § E get(int index) - Returns the element at position index in the list § E set(int index, E obj) — Replaces the element at position index with obj;returns the element formerly at position index § E remove(int index) — Removes element from position index, moving elements at position index + 1 and higher to the left (subtracts 1 from their indices) and subtracts 1 from size; returns the element formerly at position index |
7.3 Traversing ArrayLists
DATES
TOPIC | 7.3 Traversing ArrayLists | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. | |||
LEARNING OBJECTIVE | VAR-2.E For ArrayList objects: a. Traverse using a for or while loop b. Traverse using an enhanced for loop | |||
ESSENTIAL KNOWLEDGE | VAR-2.E.1 Iteration statements can be used to access all the elements in an ArrayList. This is called traversing the ArrayList. | VAR-2.E.2 Deleting elements during a traversal of an ArrayList requires using special techniques to avoid skipping elements. | VAR-2.E.3 Since the indices for an ArrayList start at 0 and end at the number of elements − 1, accessing an index value outside of this range will result in an ArrayIndexOutOfBoundsException being thrown. | VAR-2.E.4 Changing the size of an ArrayList while traversing it using an enhanced for loop can result in a ConcurrentModificationException being thrown. Therefore, when using an enhanced for loop to traverse an ArrayList, you should not add or remove elements. |
7.4 Developing Algorithms Using ArrayLists
DATES
TOPIC | 7.4 Developing Algorithms Using ArrayLists | |
---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | |
LEARNING OBJECTIVE | CON-2.J For algorithms in the context of a particular specification that requires the use of ArrayList traversals: § Identify standard algorithms. § Modify standard algorithms. § Develop an algorithm. | |
ESSENTIAL KNOWLEDGE | CON-2.J.1 There are standard ArrayList algorithms that utilize traversals to: § Insert elements § Delete elements § Apply the same standard algorithms that are used with 1D arrays | CON-2.J.2 Some algorithms require multiple String, array, or ArrayList objects to be traversed simultaneously |
7.5 Searching
DATES
TOPIC | 7.5 Searching | |
---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | |
LEARNING OBJECTIVE | CON-2.K Apply sequential/linear search algorithms to search for specific information in array or ArrayList objects. | |
ESSENTIAL KNOWLEDGE | CON-2.K.1 There are standard algorithms for searching. | CON-2.K.2 Sequential/linear search algorithms check each element in order until the desired value is found or all elements in the array or ArrayList have been checked. |
7.6 Sorting
DATES
TOPIC | 7.6 Sorting | |
---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | |
LEARNING OBJECTIVE | CON-2.L Apply selection sort and insertion sort algorithms to sort the elements of array or ArrayList objects. | CON-2.M Compute statement execution counts and informal run-time comparison of sorting algorithms. |
ESSENTIAL KNOWLEDGE | CON-2.L.1 Selection sort and insertion sort are iterative sorting algorithms that can be used to sort elements in an array or ArrayList. | CON-2.M.1 Informal run-time comparisons of program code segments can be made using statement execution counts. |
7.7 Ethical Issues Around Data Collection
DATES
TOPIC | 7.7 Ethical Issues Around Data Collection | |
---|---|---|
ENDURING UNDERSTANDING | IOC-1 While programs are typically designed to achieve a specific purpose, they may have unintended consequences. | |
LEARNING OBJECTIVE | IOC-1.B Explain the risks to privacy from collecting and storing personal data on computer systems. | |
ESSENTIAL KNOWLEDGE | IOC-1.B.1 When using the computer, personal privacy is at risk. Programmers should attempt to safeguard personal privacy. | IOC-1.B.2 Computer use and the creation of programs have an impact on personal security. These impacts can be beneficial and/or harmful. |
Activities
Sample Activities | Predict and compare Have students look at the code they wrote to solve the free-response question in Unit 6 (or other code from Unit 6) on paper, and have them rewrite it using an ArrayList. Have them highlight the parts that need to be changed and determine how to change them. Then, have students type up the changes in an IDE and confirm that the program still works as expected. |
---|---|
Identify a subtask Have students read through an ArrayList-based free-response question in groups, and have them identify all subtasks. These subtasks could be conditional statements, iteration, or even other methods. Once the subtasks have been identified, divide the subtasks among the group members, and have students implement their given subtask. When all students are finished, have them combine the subtasks into a single solution. |
|
Discussion group Discuss the algorithm necessary to search for the smallest value in an ArrayList. Without explaining what you are doing, change the Boolean expression so that it will find the largest value, and ask students to describe what the resulting algorithm will do. Then, change the algorithm to store and return the location of the largest value, and discuss the change. |
UNIT 8: 2D Array
Overview
AP EXAM WEIGHTING | 7.5–10% |
CLASS PERIODS | ~10–12 |
OVERVIEW | In Unit 6, students learned how 1D arrays store large amounts of related data. These same concepts will be implemented with two-dimensional (2D) arrays in this unit. A 2D array is most suitable to represent a table. Each table element is accessed using the variable name and row and column indices. Unlike 1D arrays, 2D arrays require nested iterative statements to traverse and access all elements. The easiest way to accomplished this is in row-major order, but it is important to cover additional traversal patterns, such as back and forth or column-major. |
8.1 2D Arrays
DATES
TOPIC | 8.1 2D Arrays | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. | ||||
LEARNING OBJECTIVE | VAR-2.F Represent collections of related primitive or object reference data using two-dimensional (2D) array objects. | ||||
ESSENTIAL KNOWLEDGE | VAR-2.F.1 2D arrays are stored as arrays of arrays. Therefore, the way 2D arrays are created and indexed is similar to 1D array objects. X EXCLUSION STATEMENT—(EK VAR-2.F.1): 2D array objects that are not rectangular are outside the scope of the course and AP Exam. | VAR-2.F.2 For the purposes of the exam, when accessing the element at arr[first][second], the first index is used for rows, the second index is used for columns. | VAR-2.F.3 The initializer list used to create and initialize a 2D array consists of initializer lists that represent 1D arrays. | VAR-2.F.4 The square brackets [row][col] are used to access and modify an element in a 2D array. | VAR-2.F.5 “Row-major order” refers to an ordering of 2D array elements where traversal occurs across each row, while “column-major order” traversal occurs down each column. |
8.2 Traversing 2D Arrays
DATES
TOPIC | 8.2 Traversing 2D Arrays | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | VAR-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | |||
LEARNING OBJECTIVE | VAR-2.G For 2D array objects: § Traverse using nested for loops. § Traverse using nested enhanced for loops. | CON-2.N For algorithms in the context of a particular specification that requires the use of 2D array traversals: § Identify standard algorithms. § Modify standard algorithms. § Develop an algorithm. | |||
ESSENTIAL KNOWLEDGE | VAR-2.G.1 Nested iteration statements are used to traverse and access all elements in a 2D array. Since 2D arrays are stored as arrays of arrays, the way 2D arrays are traversed using for loops and enhanced for loops is similar to 1D array objects. | VAR-2.G.2 Nested iteration statements can be written to traverse the 2D array in “row-major order” or “column-major order.” | VAR-2.G.3 The outer loop of a nested enhanced for loop used to traverse a 2D array traverses the rows. Therefore, the enhanced for loop variable must be the type of each row, which is a 1D array. The inner loop traverses a single row. Therefore, the inner enhanced for loop variable must be the same type as the elements stored in the 1D array | CON-2.N.1 When applying sequential/linear search algorithms to 2D arrays, each row must be accessed then sequential/linear search applied to each row of a 2D array | CON-2.N.2 All standard 1D array algorithms can be applied to 2D array objects. |
Activities
Sample Activities | Using manipulatives Use different-sized egg cartons or ice cube trays with random compartments filled with small toys or candy. Create laminated cards with the code for the construction of, and access to, a 2D array, leaving blanks for the name and size dimensions. Have students fill in the missing code that would be used to represent the physical 2D array objects and access the randomly stored elements |
---|---|
Activating prior knowledge When first introducing 2D arrays and row-major traversal, ask students which part of the nested for loop structure loops over a 1D array. Based on what they know about the traversal of 1D array structures, ask them to calculate the number of times the inner loop executes. |
|
Sharing and responding As a class, create a set of test cases to be used with answers to a free-response question. Have students write their answers to the free-response question individually on paper. After exchanging solutions with another student, ask students to find errors or validate results of their peers’ code by tracing the code with the developed test cases. Allow students an opportunity to provide feedback on the program code as well as the results of each test case. |
UNIT 9: Inheritance
Overview
AP EXAM WEIGHTING | 5–10% |
CLASS PERIODS | ~14–15 |
OVERVIEW | Creating objects, calling methods on the objects created, and being able to define a new data type by creating a class are essential understandings before moving into this unit. One of the strongest advantages of Java is the ability to categorize classes into hierarchies through inheritance. Certain existing classes can be extended to include new behaviors and attributes without altering existing code. These newly created classes are called subclasses. In this unit, students will learn how to recognize common attributes and behaviors that can be used in a superclass and will then create a hierarchy by writing subclasses to extend a superclass. Recognizing and utilizing existing hierarchies will help students create more readable and maintainable programs. |
9.1 Creating Superclasses and Subclasses
DATES
TOPIC | 9.1 Creating Superclasses and Subclasses | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. | |||
LEARNING OBJECTIVE | MOD-3.B Create an inheritance relationship from a subclass to the superclass. | |||
ESSENTIAL KNOWLEDGE | MOD-3.B.1 A class hierarchy can be developed by putting common attributes and behaviors of related classes into a single class called a superclass. | MOD-3.B.2 Classes that extend a superclass, called subclasses, can draw upon the existing attributes and behaviors of the superclass without repeating these in the code. | MOD-3.B.3 Extending a subclass from a superclass creates an “is-a” relationship from the subclass to the superclass. | MOD-3.B.4 The keyword extends is used to establish an inheritance relationship between a subclass and a superclass. A class can extend only one superclass. |
9.2 Writing Constructors for Subclasses
DATES
TOPIC | 9.2 Writing Constructors for Subclasses | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. | ||||
LEARNING OBJECTIVE | MOD-3.B Create an inheritance relationship from a subclass to the superclass. | ||||
ESSENTIAL KNOWLEDGE | MOD-3.B.5 Constructors are not inherited. | MOD-3.B.6 The superclass constructor can be called from the first line of a subclass constructor by using the keyword super and passing appropriate parameters. | MOD-3.B.7 The actual parameters passed in the call to the superclass constructor provide values that the constructor can use to initialize the object’s instance variables. | MOD-3.B.8 When a subclass’s constructor does not explicitly call a superclass’s constructor using super, Java inserts a call to the superclass’s no-argument constructor. | MOD-3.B.9 Regardless of whether the superclass constructor is called implicitly or explicitly, the process of calling superclass constructors continues until the Object constructor is called. At this point, all of the constructors within the hierarchy execute beginning with the Object constructor. |
9.3 Overriding Methods
DATES
TOPIC | 9.3 Overriding Methods | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. | |||
LEARNING OBJECTIVE | LEARNING OBJECTIVE MOD-3.B Create an inheritance relationship from a subclass to the superclass. | |||
ESSENTIAL KNOWLEDGE | MOD-3.B.10 Method overriding occurs when a public method in a subclass has the same method signature as a public method in the superclass. | MOD-3.B.11 Any method that is called must be defined within its own class or its superclass. | MOD-3.B.12 A subclass is usually designed to have modified (overridden) or additional methods or instance variables. | MOD-3.B.13 A subclass will inherit all public methods from the superclass; these methods remain public in the subclass. |
9.4 super Keyword
DATES
TOPIC | 9.4 super Keyword | |
---|---|---|
ENDURING UNDERSTANDING | MOD-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. | |
LEARNING OBJECTIVE | MOD-3.B Create an inheritance relationship from a subclass to the superclass. | |
ESSENTIAL KNOWLEDGE | MOD-3.B.14 The keyword super can be used to call a superclass’s constructors and methods. | MOD-3.B.15 The superclass method can be called in a subclass by using the keyword super with the method name and passing appropriate parameters. |
9.5 Creating References Using Inheritance Hierarchies
DATES
TOPIC | 9.5 Creating References Using Inheritance Hierarchies | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. | |||
LEARNING OBJECTIVE | MOD-3.C Define reference variables of a superclass to be assigned to an object of a subclass in the same hierarchy. | |||
ESSENTIAL KNOWLEDGE | MOD-3.C.1 When a class S “is-a” class T, T is referred to as a superclass, and S is referred to as a subclass. | MOD-3.C.2 If S is a subclass of T, then assigning an object of type S to a reference of type T facilitates polymorphism. | MOD-3.C.3 If S is a subclass of T, then a reference of type T can be used to refer to an object of type T or S. | MOD-3.C.4 Declaring references of type T, when S is a subclass of T, is useful in the following declarations: § Formal method parameters § arrays — T[] var ArrayList<T> var |
9.6 Polymorphism
DATES
TOPIC | 9.6 Polymorphism | ||
---|---|---|---|
ENDURING UNDERSTANDING | MOD-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. | ||
LEARNING OBJECTIVE | MOD-3.D Call methods in an inheritance relationship. | ||
ESSENTIAL KNOWLEDGE | MOD-3.D.1 Utilize the Object class through inheritance. | MOD-3.D.2 At compile time, methods in or inherited by the declared type determine the correctness of a non-static method call. | MOD-3.D.3 At run-time, the method in the actual object type is executed for a non-static method call. |
9.7 Object Superclass
DATES
TOPIC | 9.7 Object Superclass | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | MOD-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. | |||
LEARNING OBJECTIVE | MOD-3.E Call Object class methods through inheritance. | |||
ESSENTIAL KNOWLEDGE | MOD-3.E.1 The Object class is the superclass of all other classes in Java. | MOD-3.E.2 The Object class is part of the java.lang package | MOD-3.E.3 The following Object class methods and constructors—including what they do and when they are used—are part of the Java Quick Reference: § boolean equals(Object other) § String toString() | MOD-3.E.4 Subclasses of Object often override the equals and toString methods with classspecific implementations. |
Activities
Sample Activities | Activating prior knowledge Have students review what they know about classes, methods, and the scope of variables by having them write a class based on specifications that can easily be extended by subclasses. This class will become the superclass for subclasses they write later in the unit. |
---|---|
Create a plan Given a class design problem that requires the use of multiple classes in an inheritance hierarchy, students identify the common attributes and behaviors among these classes and write these into a superclass. Any additional information that does not belong in the superclass will be categorized to determine the additional classes that might be necessary and what methods will need to be added or overridden in the subclasses. |
|
Think aloud Provide students with a code segment that contains method calls using the super keyword. Have students describe the code segment out loud to themselves. Give students several individual statements that attempt to interact with the given code segment, and have them talk through each one, describing which statements would work and which ones would not, as well as the reasons why those statements wouldn’t work. |
|
Student response system Provide students with several statements where objects are created and the reference type and object type are different but related. Then provide students with calls to methods on these created objects. Use a student response system to have students determine whether each statement is legal, would result in a compile-time error, or would result in a run-time error. |
UNIT 10: Recursion
Overview
AP EXAM WEIGHTING | 5–7.5% |
CLASS PERIODS | ~3–5 |
OVERVIEW | Sometimes a problem can be solved by solving smaller or simpler versions of the same problem rather than attempting an iterative solution. This is called recursion, and it is a powerful math and computer science idea. In this unit, students will revisit how control is passed when methods are called, which is necessary knowledge when working with recursion. Tracing skills introduced in Unit 2 are helpful for determining the purpose or output of a recursive method. In this unit, students will learn how to write simple recursive methods and determine the purpose or output of a recursive method by tracing. |
10.1 Recursion
DATES
TOPIC | 10.1 Recursion | |||||
---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | |||||
LEARNING OBJECTIVE | CON-2.O Determine the result of executing recursive methods. | |||||
ESSENTIAL KNOWLEDGE | CON-2.O.1 A recursive method is a method that calls itself | CON-2.O.2 Recursive methods contain at least one base case, which halts the recursion, and at least one recursive call. | CON-2.O.3 Each recursive call has its own set of local variables, including the formal parameters. | CON-2.O.4 Parameter values capture the progress of a recursive process, much like loop control variable values capture the progress of a loop. | CON-2.O.5 Any recursive solution can be replicated through the use of an iterative approach. X EXCLUSION STATEMENT—(EK CON-2.O.5): Writing recursive program code is outside the scope of the course and AP Exam. | CON-2.O.6 Recursion can be used to traverse String, array, and ArrayList objects. |
10.2 Recursive Searching and Sorting
DATES
TOPIC | 10.2 Recursive Searching and Sorting | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | CON-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. | ||||
LEARNING OBJECTIVE | CON-2.P Apply recursive search algorithms to information in String, 1D array, or ArrayList objects. | CON-2.Q Apply recursive algorithms to sort elements of array or ArrayList objects. | |||
ESSENTIAL KNOWLEDGE | CON-2.P.1 Data must be in sorted order to use the binary search algorithm. | CON-2.P.2 The binary search algorithm starts at the middle of a sorted array or ArrayList and eliminates half of the array or ArrayList in each iteration until the desired value is found or all elements have been eliminated. | CON-2.P.3 Binary search can be more efficient than sequential/linear search. X EXCLUSION STATEMENT—(EK CON-2.P.3): Search algorithms other than sequential/linear and binary search are outside the scope of the course and AP Exam. | CON-2.P.4 The binary search algorithm can be written either iteratively or recursively. | CON-2.Q.1 Merge sort is a recursive sorting algorithm that can be used to sort elements in an array or ArrayList. |
Activities
Sample Activities | Sharing and responding Provide students with the pseudocode to multiple recursive algorithms, and have students write the base case of the recursive methods and share it with their partner. The partner should then provide feedback, including any corrections or additions that may be needed. |
---|---|
Look for a pattern Provide students with a recursive method and several different inputs. Have students run the recursive method, record the various outputs, and look for a pattern between the input and related output. Ask students to write one or two sentences as a broad description of what the recursive method is doing. |
|
Code tracing When looking at a recursive method to determine how many times it executes, have students create a call tree or a stack trace to show the method being called and the values of any parameters of each call. Students can then count up the number of times a statement executes or a method is called. |
×
Teacher | Mr. Wiessmann |
Subject | AP Computer Science Principles |
edwiessmann@philasd.org | |
Cell Phone | 215-900-8742 |
School Phone | 215-351-7618 |
Course Description | The AP Computer Science Principles course is designed to be equivalent to a first- semester introductory college computing course. In this course, students will develop computational thinking skills vital for success across all disciplines, such as using computational tools to analyze and study data and working with large data sets to analyze, visualize, and draw conclusions from trends. The course engages students in the creative aspects of the field by allowing them to develop computational artifacts based on their interests. Students will also develop effective communication and collaboration skills by working individually and collaboratively to solve problems, and will discuss and write about the impacts these solutions could have on their community, society, and the world. |
Assessments | Students will be assessed on a variety of Projects, Written Assessments, and Formal Assessments. Students are required to participate during class time. |
Grading Policy | 10% Homework 20% Classwork 30% Performance Based Learning 40% Tests |
Period Length (minutes) | 47 |
Materials List | Pen or Pencil for Writing Notebook for Journal Entries, Notes, and Constructive Response Questions |
Books: | Computer Science Illuminated 3rd Addition |
https://runestone.academy/runestone/default/user/login?_next=/runestone/default/index | |
Class Rules: | Students must obey the school wide rules of the Academy @ Palumbo at all times. |
Tutoring | After School Tuesday & Thursday 3:00-6:00 by appointment |
AP Computer Science Principles Course Homepage: | http://apcentral.collegeboard.com/apc/public/courses/teachers_corner/231724.html |
AP CSP College Board: | https://apcentral.collegeboard.org/courses/ap-computer-science-principles?course=ap-computer-science-principles |
Classroom Website: | phillycomputerscience.com |
AP Exam Date: | May 11 Afternoon |
AP Exam Schedule: | https://professionals.collegeboard.com/testing/ap/about/dates |
Code.org Resources | https://studio.code.org/courses/csp-2018 |
---|---|
Crash Course Resources | https://www.youtube.com/playlist?list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo |
×
Big Ideas | ||
PRACTICE 1: Computational Solution Design | Design and evaluate computational solutions for a purpose. |
1.A Investigate the situation, context, or task. 1.B Determine and design an appropriate method or approach to achieve the purpose. 1.C Explain how collaboration affects the development of a solution. 1.D Evaluate solution options. |
PRACTICE 2: Algorithms and Program Development | Develop and implementalgorithms. |
2.A Represent algorithmic processes without using a programming language. 2.B Implement and apply an algorithm. |
PRACTICE 3: Abstraction in Program Development | Develop programs that incorporate abstractions. |
3.A Generalize data sources through variables. 3.B Use abstraction to manage complexity in a program. 3.C Explain how abstraction manages complexity. |
PRACTICE 4: Code Analysis | Evaluate and test algorithms and programs. |
4.A Explain how a code segment or program functions. 4.B Determine the result of code segments. 4.C Identify and correct errors in algorithms and programs, including error discovery through testing. |
PRACTICE 5: Computing Innovations | Investigate computing innovations. |
5.A Explain how computing systems work. 5.B Explain how knowledge can be generated from data. 5.C Describe the impact of a computing innovation. 5.D Describe the impact of gathering data. 5.E Evaluate the use of computing based on legal and ethical factors. |
PRACTICE 6: Responsible Computing | Contribute to an inclusive, safe, collaborative, and ethical computing culture. |
6.A Collaborate in the development of solutions. 6.B Use safe and secure methods when using computing devices. 6.C Acknowledge the intellectual property of others. |
×
Units | |
BIG IDEA 1 CREATIVE DEVELOPMENT (CRD) |
When developing computing innovations, developers can use a formal, iterative design process or a less rigid process of experimentation. While using either approach, developers will encounter phases of investigating and reflecting, designing, prototyping, and testing. Additionally, collaboration is an important tool at any phase of development, because considering multiple perspectives allows for improvement of innovations. |
BIG IDEA 2 DATA (DAT) |
Data are central to computing innovations because they communicate initial conditions to programs and represent new knowledge. Computers consume data, transform data, and produce new data, allowing users to create new information or knowledge to solve problems through the interpretation of those data. Computers store data digitally, which means that the data must be manipulated in order to be presented in a useful way to the user. |
BIG IDEA 3 ALGORITHMS AND PROGRAMMING (AAP) |
Programmers integrate algorithms and abstraction to create programs for creative purposes and to solve problems. Using multiple program statements in a specified order, making decisions, and repeating the same process multiple times are the building blocks of programs. Incorporating elements of abstraction”by breaking problems down into interacting pieces, each with their own purpose”makes writing complex programs easier. Programmers need to think algorithmically and use abstraction to define and interpret processes that are used in a program. |
BIG IDEA 4 COMPUTING SYSTEMS AND NETWORKS (CSN) |
Computer systems and networks are used to transfer data. One of the largest and most commonly used networks is the Internet. Through a series of protocols, the Internet can be used to send and receive information and ideas throughout the world. Transferring and processing information can be slow when done on a single computer, but leveraging multiple computers to do the work at the same time can significantly shorten the time it takes to complete tasks or solve problems. |
BIG IDEA 5 IMPACT OF COMPUTING (IOC) |
Computers and computing have revolutionized our lives. To use computing safely and responsibly, we need to be aware of privacy, security, and ethical issues. As programmers, we need to understand the potential impacts of our programs and be responsible for the consequences. As computer users, we need to understand any potential beneficial or harmful effects and how to protect ourselves and our privacy when using a computer. |
** | Most of the text in this Syllabus were taken from Collegeboard CSP resources |
×
TOPIC | Lesson | Assignment |
---|---|---|
Blockchain | https://www.youtube.com/watch?v=hYip_Vuv8J0 | Write a one page summary of what blockchiain is. How did the narrator connect with each audience. What level was most helpful for you? |
IP Address | https://www.youtube.com/watch?v=7_-qWlvQQtY | Find two other sources describing ip addresses and reference theses in your paper. Write a one page summary about how private your data is online based on what you have learned by researching ip addresses. |
Binary Math | https://www.youtube.com/watch?v=XKu_SEDAykw&t=1043s | Write a one page summary on the question that the engineer for google had to answer. Explain the problem and the stages of development the interview went over. Why is communication important? |
CREATIVE DEVELOPMENT (CRD)
DATA (DAT)
ALGORITHMS AND PROGRAMMING (AAP)
COMPUTING SYSTEMS AND NETWORKS (CSN)
IMPACT OF COMPUTING (IOC)
CREATE TASK
×
UNIT 1: CREATIVE DEVELOPMENT (CRD)
Overview
AP EXAM WEIGHTING | 10–13% |
CLASS PERIODS | ~17 |
OVERVIEW |
Collaboration is crucial when developing computing innovations, because having multiple perspectives offers opportunities to improve the design of innovations. In this big idea, students work collaboratively to design and develop programs using an iterative development process. They identify the needs of all users by gathering input from people from different backgrounds and demographics. Once the program is developed, they test it to ensure it meets these needs. Effective collaboration can often differ from group work, because it requires equal participation and voice from all members of the group. Early in the school year, it may be helpful for teachers to establish practices and norms that facilitate a collaborative environment and provide students with time to practice working together. Content in this big idea is often paired with Big Idea 3: Algorithms and Programming. |
Essential Questions | CRD-1
|
1.1 Collaboration
DATES
TOPIC | 1.1 Collaboration | ||||||||
---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | CRD-1 Incorporating multiple perspectives through collaboration improves computing innovations as they are developed. | ||||||||
LEARNING OBJECTIVE | CRD-1.A Explain how computing innovations are improved through collaboration. 1.C | CRD-1.B Explain how computing innovations are developed by groups of people.‚ 1.C | CRD-1.C Demonstrate effective interpersonal skills during collaboration.‚ 1.C | ||||||
ESSENTIAL KNOWLEDGE | CRD-1.A.1 A computing innovation includes a program as an integral part of its function. | CRD-1.A.2 A computing innovation can be physical (e.g., self-driving car), nonphysical computing software (e.g., picture editing software), or a nonphysical computing concept (e.g., e-commerce). | CRD-1.A.3 Effective collaboration produces a computing innovation that reflects the diversity of talents and perspectives of those who designed it. | CRD-1.A.4 Collaboration that includes diverse perspectives helps avoid bias in the development of computing innovations. | CRD-1.A.5 Consultation and communication with users are important aspects of the development of computing innovations. | CRD-1.A.6 Information gathered from potential users can be used to understand the purpose of a program from diverse perspectives and to develop a program that fully incorporates these perspectives. | CRD-1.B.1 Online tools support collaboration by allowing programmers to share and provide feedback on ideas and documents. | CRD-1.B.2 Common models such as pair programming exist to facilitate collaboration. | CRD-1.C.1 Effective collaborative teams practice interpersonal skills, including but not limited to:
|
1.2 Program Function and Purpose
DATES
TOPIC | 1.2 Program Function and Purpose | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | CRD-2 Developers create and innovate using an iterative design process that is userfocused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking. | |||
LEARNING OBJECTIVE | CRD-2.A Describe the purpose of a computing innovation.‚ 1.A | CRD-2.B Explain how a program or code segment functions. 4.A | CRD-2.C Identify input(s) to a program.‚ 3.A | CRD-2.D Identify output(s) produced by a program.‚ 3.A |
ESSENTIAL KNOWLEDGE |
|
|
|
|
1.3 Program Design and Development
DATES
TOPIC | 1.3 Program Design and Development | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | CRD-2 Developers create and innovate using an iterative design process that is userfocused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking. | |||
LEARNING OBJECTIVE | CRD-2.E Develop a program using a development process.‚ 1.B | CRD-2.F Design a program and its user interface.‚ 1.B | CRD-2.G Describe the purpose of a code segment or program by writing documentation.‚ 4.A | CRD-2.H Acknowledge code segments used from other sources.‚ 1.C |
ESSENTIAL KNOWLEDGE |
|
|
|
|
1.4 Identifying and Correcting Errors
DATES
TOPIC | 1.4 Identifying and Correcting Errors | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | CRD-2 Developers create and innovate using an iterative design process that is userfocused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking. | ||||||||||
LEARNING OBJECTIVE | CRD-2.I
For errors in an algorithm or
program:
|
CRD-2.J Identify inputs and corresponding expected outputs or behaviors that can be used to check the correctness of an algorithm or program.‚ 4.C | |||||||||
ESSENTIAL KNOWLEDGE | CRD-2.I.1 A logic error is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly | CRD-2.I.2 A syntax error is a mistake in the program where the rules of the programming language are not followed. | CRD-2.I.3 A run-time error is a mistake in the program that occurs during the execution of a program. Programming languages define their own runtime errors. | CRD-2.I.4 An overflow error is an error that occurs when a computer attempts to handle a number that is outside of the defined range of values. | CRD-2.I.5
The following are effective ways to find and correct errors:
|
CRD-2.J.1 In the development process, testing uses defined inputs to ensure that an algorithm or program is producing the expected outcomes. Programmers use the results from testing to revise their algorithms or programs. | CRD-2.J.2 Defined inputs used to test a program should demonstrate the different expected outcomes that are at or just beyond the extremes (minimum and maximum) of input data. | CRD-2.J.3 Program requirements are needed to identify appropriate defined inputs for testing. |
Activities
Sample Activities | Sharing and responding Have students develop a list of three questions that they would like to use data to answer. Then, in small groups, ask each student to share one of their questions. The group will respond with feedback to improve the focus and direction of the question. Students should take turns sharing their questions until all questions have been considered. Finally, ask each group to come to a consensus on which three questions they will answer with data. |
---|---|
Diagramming In small groups, have students play a board game for 10 minutes. As they play, ask them to record the actions (such as rolling the dice or moving their piece) and decisions made in a diagram or flowchart. Have students trade games with another group and play the game using the diagram for directions. Students should identify and correct where the diagram might not be accurate or have missing steps. See the Language and Logic of Computing: Algorithmic Thinking Teaching and Assessing Module in the Professional Learning section of AP Classroom for a more detailed lesson plan and video example. |
UNIT 2: Data
Overview
AP EXAM WEIGHTING | 17–22% |
CLASS PERIODS | ~19 |
OVERVIEW | Because essentially everything we do with a computer is being broken down into some form of data, it is important for students to develop a breadth of understanding of how computers handle data and how students can use those same data to solve problems such as raising awareness for a cause, using census data to determine which state will gain seats in the House of Representatives, or using traffic and cost data to determine the ideal location for prom. In this big idea, students will gain a deep understanding of how information is stored on a computer in binary and seamlessly translated into what is seen on the screen or heard through speakers. Students will also learn how data are processed to learn something new. This big idea is often paired with Big Idea 3: Algorithms and Programming and Big Idea 5: Impact of Computing. |
ESSENTIAL QUESTIONS |
DAT-1
|
2.1 Binary Numbers
DATES
TOPIC | 2.1 Binary Numbers | ||
---|---|---|---|
ENDURING UNDERSTANDING | DAT-1 The way a computer represents data internally is different from the way the data are interpreted and displayed for the user. Programs are used to translate data into a representation more easily understood by people. | ||
LEARNING OBJECTIVE | DAT-1.A Explain how data can be represented using bits. 3.C | DAT-1.B Explain the consequences of using bits to represent data.‚ 1.D | DAT-1.C
For binary numbers:
|
ESSENTIAL KNOWLEDGE |
|
|
|
2.2 Data Compression
DATES
TOPIC | 2.2 Data Compression | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | DAT-1 The way a computer represents data internally is different from the way the data are interpreted and displayed for the user. Programs are used to translate data into a representation more easily understood by people. | |||||||||||
LEARNING OBJECTIVE | DAT-1.D Compare data compression algorithms to determine which is best in a particular context.‚ 1.D | |||||||||||
ESSENTIAL KNOWLEDGE | DAT-1.D.1 Data compression can reduce the size (number of bits) of transmitted or stored data. | DAT-1.D.2 Fewer bits does not necessarily mean less information. | DAT-1.D.3 The amount of size reduction from compression depends on both the amount of redundancy in the original data representation and the compression algorithm applied. | DAT-1.D.4 Lossless data compression algorithms can usually reduce the number of bits stored or transmitted while guaranteeing complete reconstruction of the original data. | DAT-1.D.5 Lossy data compression algorithms can significantly reduce the number of bits stored or transmitted but only allow reconstruction of an approximation of the original data. | DAT-1.D.6 Lossy data compression algorithms can usually reduce the number of bits stored or transmitted more than lossless compression algorithms. | DAT-1.D.7 In situations where quality or ability to reconstruct the original is maximally important, lossless compression algorithms are typically chosen. | DAT-1.D.8 In situations where minimizing data size or transmission time is maximally important, lossy compression algorithms are typically chosen. |
2.3 Extracting Information from Data
DATES
TOPIC | 2.3 Extracting Information from Data | ||
---|---|---|---|
ENDURING UNDERSTANDING | DAT-2 Programs can be used to process data, which allows users to discover information and create new knowledge. | ||
LEARNING OBJECTIVE | DAT-2.A Describe what information can be extracted from data.‚ 5.B | DAT-2.B Describe what information can be extracted from metadata.‚ 5.B | DAT-2.C Identify the challenges associated with processing data.‚ 5.D |
ESSENTIAL KNOWLEDGE |
|
|
|
2.4 Using Programs with Data
DATES
TOPIC | 2.4 Using Programs with Data | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | DAT-2 Programs can be used to process data, which allows users to discover information and create new knowledge. | ||||||||||
LEARNING OBJECTIVE | DAT-2.D Extract information from data using a program. 2.B | DAT-2.E Explain how programs can be used to gain insight and knowledge from data.‚ 5.B | |||||||||
ESSENTIAL KNOWLEDGE | DAT-2.D.1 Programs can be used to process data to acquire information. | DAT-2.D.2 Tables, diagrams, text, and other visual tools can be used to communicate insight and knowledge gained from data. | DAT-2.D.3 Search tools are useful for efficiently finding information. | DAT-2.D.4 Data filtering systems are important tools for finding information and recognizing patterns in data. | DAT-2.D.5 Programs such as spreadsheets help efficiently organize and find trends in information. | DAT-2.D.6
Some processes that can be used to extract or modify information from data include the following:
|
DAT-2.E.1 Programs are used in an iterative and interactive way when processing information to allow users to gain insight and knowledge about data. | DAT-2.E.2 Programmers can use programs to filter and clean digital data, thereby gaining insight and knowledge. | DAT-2.E.3 Combining data sources, clustering data, and classifying data are parts of the process of using programs to gain insight and knowledge from data. | DAT-2.E.4 Insight and knowledge can be obtained from translating and transforming digitally represented information. | DAT-2.E.5 Patterns can emerge when data are transformed using programs. |
Activities
Sample Activities | Look for a pattern Provide students with a sentence or paragraph of compressed lossless text and a key. Have them look for patterns in their process of retrieving the original text and evaluate whether this is the best compression algorithm to use. Have them write down the patterns they see along with their evaluation and share these in a large group |
---|---|
Diagramming Give students a question and a list of data. Have them diagram a process that could be used to answer the question using the data, making sure to include the input(s) of information and the output of the transformed data. Have students include an explanation of how the process represented in their diagram would work to find the solution. |
UNIT 3: Algorithms and Programming
Overview
AP EXAM WEIGHTING | 30–35% |
CLASS PERIODS | ~45 |
OVERVIEW | All programming languages, whether block-based or text-based, use similar programming structures and commands. Having a basic understanding of how these building blocks are combined to form algorithms and abstractions in one language makes it easier to apply these same understandings to other programming languages. This big idea focuses on determining the efficiency of algorithms, as well as writing and implementing algorithms in a program. This big idea can be paired with any of the other big ideas and taught throughout the school year. |
ESSENTIAL QUESTIONS | AAP-1
|
---|
3.1 Variables and Assignments
DATES
TOPIC | 3.1 Variables and Assignments | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-1 To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways. | ||||||
LEARNING OBJECTIVE | AAP-1.A Represent a value with a variable. 3.A | AAP-1.B Determine the value of a variable as a result of an assignment.‚ 4.B | |||||
ESSENTIAL KNOWLEDGE | AAP-1.A.1 A variable is an abstraction inside a program that can hold a value. Each variable has associated data storage that represents one value at a time, but that value can be a list or other collection that in turn contains multiple values. | AAP-1.A.2 Using meaningful variable names helps with the readability of program code and understanding of what values are represented by the variables. | AAP-1.A.3 Some programming languages provide types to represent data, which are referenced using variables. These types include numbers, Booleans, lists, and strings. | AAP-1.A.4 Some values are better suited to representation using one type of datum rather than another | AAP-1.B.1 The assignment operator allows a program to change the value represented by a variable. | AAP-1.B.2
The exam reference sheet provides the "←" operator to use for assignment. For example: a←expression evaluates expression and then assigns a copy of the result to the variable a. |
AAP-1.B.3
The value stored in a variable will be the most recent value assigned. For example: a←1 b←a a←2 display(b) still displays 1. |
3.2 Data Abstraction
DATES
TOPIC | 3.2 Data Abstraction | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-1 To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways. | |||||||||||
LEARNING OBJECTIVE | AAP-1.C Represent a list or string using a variable.‚ 3.A | AAP-1.D
For data abstraction:
|
||||||||||
ESSENTIAL KNOWLEDGE | AAP-1.C.1 A list is an ordered sequence of elements. For example, [value1, value2, value3, ...] describes a list where value1 is the first element, value2 is the second element, value3 is the third element, and so on. | AAP-1.C.2 An element is an individual value in a list that is assigned a unique index. | AAP-1.C.3 An index is a common method for referencing the elements in a list or string using natural numbers. | AAP-1.C.4 A string is an ordered sequence of characters. | AAP-1.D.1 Data abstraction provides a separation between the abstract properties of a data type and the concrete details of its representation. | AAP-1.D.2 Data abstractions manage complexity in programs by giving a collection of data a name without referencing the specific details of the representation. | AAP-1.D.3 Data abstractions can be created using lists. | AAP-1.D.4 Developing a data abstraction to implement in a program can result in a program that is easier to develop and maintain. | AAP-1.D.5 Data abstractions often contain different types of elements. | AAP-1.D.6 The use of lists allows multiple related items to be treated as a single value. Lists are referred to by different names, such as array, depending on the programming language. | AAP-1.D.7
The exam reference sheet provides the notation [value1, value2, value3, ...] to create a list with those values as the first, second, third, and so on items. For example,
|
AAP-1.D.8 The exam reference sheet describes a list structure whose index values are 1 through the number of elements in the list, inclusive. For all list operations, if a list index is less than 1 or greater than the length of the list, an error message is produced and the program will terminate. |
3.3 Mathematical Expressions
DATES
TOPIC | 3.3 Mathematical Expressions | ||
---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | ||
LEARNING OBJECTIVE | AAP-2.A Express an algorithm that uses sequencing without using a programming language.‚ 2.A | AAP-2.B Represent a step-by-step algorithmic process using sequential code statements. 2.B | AAP-2.C Evaluate expressions that use arithmetic operators.‚ 4.B |
ESSENTIAL KNOWLEDGE |
|
|
|
3.4 Strings
DATES
TOPIC | 3.4 Strings | |
---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |
LEARNING OBJECTIVE | AAP-2.D Evaluate expressions that manipulate strings.‚ 4.B | |
ESSENTIAL KNOWLEDGE | AAP-2.D.1 String concatenation joins together two or more strings end-to-end to make a new string. | AAP-2.D.2 A substring is part of an existing string. |
3.5 Boolean Expressions
DATES
TOPIC | 3.5 Boolean Expressions | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | ||||||
LEARNING OBJECTIVE | AAP-2.E
For relationships between two variables, expressions, or values:
|
AAP-2.F
For relationships between Boolean values:
|
|||||
ESSENTIAL KNOWLEDGE | AAP-2.E.1 A Boolean value is either true or false. | AAP-2.E.2
The exam reference sheet provides the following relational operators: =, ≠, >, <, ≥, and ≤. Text and Block:
|
AAP-2.F.1 The exam reference sheet provides the logical operators NOT, AND, and OR, which evaluate to a Boolean value. | AAP-2.F.2
The exam reference sheet provides Text: NOT condition which evaluates to true if condition is false; otherwise it evaluates to false. |
AAP-2.F.3
The exam reference sheet provides
Text: condition1 AND condition2 which evaluates to true if both condition1 and condition2 are true; otherwise it evaluates to false. |
AAP-2.F.4
The exam reference sheet provides
Text: condition1 OR condition2 which evaluates to true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true; otherwise it evaluates to false. |
AAP-2.F.5 The operand for a logical operator is either a Boolean expression or a single Boolean value. |
3.6 Conditionals
DATES
TOPIC | 3.6 Conditionals | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||
LEARNING OBJECTIVE | AAP-2.G Express an algorithm that uses selection without using a programming language.‚ 2.A | AAP-2.H
For selection:
|
||
ESSENTIAL KNOWLEDGE | AAP-2.G.1 Selection determines which parts of an algorithm are executed based on a condition being true or false. | AAP-2.H.1 Conditional statements, or if-statements, affect the sequential flow of control by executing different statements based on the value of a Boolean expression. | AAP-2.H.2
The exam reference sheet provides
Text: IF(condition) { <block of statements> } in which the code in block of statements is executed if the Boolean expression condition evaluates to true; no action is taken if condition evaluates to false. |
AAP-2.H.3
The exam reference sheet provides
Text: IF(condition) { <first block of statements> } ELSE { <second block of statements> } in which the code in first block of statements is executed if the Boolean expression condition evaluates to true; otherwise, the code in second block of statements is executed. |
3.7 Nested Conditionals
DATES
TOPIC | 3.7 Nested Conditionals | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | ENDURING UNDERSTANDING AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||
LEARNING OBJECTIVE | AAP-2.I
For nested selection:
|
|||
ESSENTIAL KNOWLEDGE | AAP-2.I.1 Nested conditional statements consist of conditional statements within conditional statements. |
3.8 Iteration
DATES
TOPIC | 3.8 Iteration | |||||
---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||||
LEARNING OBJECTIVE | AAP-2.J Express an algorithm that uses iteration without using a programming language.‚ 2.A | AAP-2.K
For iteration:
|
||||
ESSENTIAL KNOWLEDGE | AAP-2.J.1 Iteration is a repeating portion of an algorithm. Iteration repeats a specified number of times or until a given condition is met. | AAP-2.K.1 Iteration statements change the sequential flow of control by repeating a set of statements zero or more times, until a stopping condition is met. | AAP-2.K.2
The exam reference sheet provides Text: REPEAT n TIMES { <block of statements> } in which the block of statements is executed n times. |
AAP-2.K.3
The exam reference sheet provides Text: REPEAT UNTIL(condition) { <block of statements> } in which the code in block of statements is repeated until the Boolean expression condition evaluates to true. |
AAP-2.K.4 In REPEAT UNTIL(condition) iteration, an infinite loop occurs when the ending condition will never evaluate to true. | AAP-2.K.5 In REPEAT UNTIL(condition) iteration, if the conditional evaluates to true initially, the loop body is not executed at all, due to the condition being checked before the loop. |
3.9 Developing Algorithms
DATES
TOPIC | 3.9 Developing Algorithms | |||||||
---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||||||
LEARNING OBJECTIVE | AAP-2.L Compare multiple algorithms to determine if they yield the same side effect or result.‚ 1.D | AAP-2.M
For algorithms:
|
||||||
ESSENTIAL KNOWLEDGE | AAP-2.L.1 Algorithms can be written in different ways and still accomplish the same tasks. | AAP-2.L.2 Algorithms that appear similar can yield different side effects or results. | AAP-2.L.3 Some conditional statements can be written as equivalent Boolean expressions. | AAP-2.L.4 Some Boolean expressions can be written as equivalent conditional statements. | AAP-2.L.5 Different algorithms can be developed or used to solve the same problem. | AAP-2.M.1 Algorithms can be created from an idea, by combining existing algorithms, or by modifying existing algorithms. | AAP-2.M.2
Knowledge of existing algorithms can help in constructing new ones. Some existing algorithms include:
|
AAP-2.M.3 Using existing correct algorithms as building blocks for constructing another algorithm has benefits such as reducing development time, reducing testing, and simplifying the identification of errors. |
3.10 Lists
DATES
TOPIC | 3.10 Lists | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | ||||||
LEARNING OBJECTIVE | AAP-2.N
For list operations:
|
AAP-2.O
For algorithms involving
elements of a list:
|
|||||
ESSENTIAL KNOWLEDGE | AAP-2.N.1
The exam reference sheet provides basic operations on lists, including:
|
AAP-2.N.2 List procedures are implemented in accordance with the syntax rules of the programming language. | AAP-2.O.1 Traversing a list can be a complete traversal, where all elements in the list are accessed, or a partial traversal, where only a portion of elements are accessed. | AAP-2.O.2 Iteration statements can be used to traverse a list. | AAP-2.O.3
The exam reference sheet provides Text: FOR EACH item IN aList { <block of statements> } The variable item is assigned the value of each element of aList sequentially, in order, from the first element to the last element. The code in block of statements is executed once for each assignment of item. |
AAP-2.O.4
Knowledge of existing algorithms that use iteration can help in constructing new algorithms. Some examples of existing algorithms that are often used with lists include:
|
AAP-2.O.5 Linear search or sequential search algorithms check each element of a list, in order, until the desired value is found or all elements in the list have been checked. |
3.11 Binary Search
DATES
TOPIC | 3.11 Binary Search | ||
---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | ||
LEARNING OBJECTIVE | AAP-2.P
For binary search algorithms:
|
||
ESSENTIAL KNOWLEDGE | AAP-2.P.1 The binary search algorithm starts at the middle of a sorted data set of numbers and eliminates half of the data; this process repeat until the desired value is found or all elements have been eliminated. | AAP-2.P.2 Data must be in sorted order to use the binary search algorithm. | AAP-2.P.3 Binary search is often more efficient than sequential/linear search when applied to sorted data. |
3.12 Calling Procedures
DATES
TOPIC | 3.12 Calling Procedures | ||||||||
---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence. | ||||||||
LEARNING OBJECTIVE | AAP-3.A
For procedure calls:
| ||||||||
ESSENTIAL KNOWLEDGE | AAP-3.A.1 A procedure is a named group of programming instructions that may have parameters and return values. | AAP-3.A.2 Procedures are referred to by different names, such as method or function, depending on the programming language. | AAP-3.A.3 Parameters are input variables of a procedure. Arguments specify the values of the parameters when a procedure is called. | AAP-3.A.4 A procedure call interrupts the sequential execution of statements, causing the program to execute the statements within the procedure before continuing. Once the last statement in the procedure (or a return statement) has executed, flow of control is returned to the point immediately following where the procedure was called. | AAP-3.A.5
The exam reference sheet provides procName(arg1, arg2, ...) as a way to call Text: PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> } which takes zero or more arguments; arg1 is assigned to parameter1, arg2 is assigned to parameter2, and so on. |
AAP-3.A.6
The exam reference sheet provides the procedure Text: DISPLAY(expression) Block: to display the value of expression, followed by a space. |
AAP-3.A.7
The exam reference sheet provides the
Text: RETURN(expression) statement, which is used to return the flow of control to the point where the procedure was called and to return the value of expression. |
AAP-3.A.8
The exam reference sheet provides result←procName(arg1, arg2, ...) to assign to result the value of the procedure being returned by calling Text: PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> RETURN(expression) } |
AAP-3.A.9
The exam reference sheet provides procedure
Text: INPUT() which accepts a value from the user and returns the input value. |
3.13 Developing Procedures
DATES
TOPIC | 3.13 Developing Procedures | ||||||||
---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence | ||||||||
LEARNING OBJECTIVE | AAP-3.B Explain how the use of procedural abstraction manages complexity in a program.‚ 3.C | AAP-3.C Develop procedural abstractions to manage complexity in a program by writing procedures.‚ 3.B | |||||||
ESSENTIAL KNOWLEDGE | AAP-3.B.1 One common type of abstraction is procedural abstraction, which provides a name for a process and allows a procedure to be used only knowing what it does, not how it does it. | AAP-3.B.2 Procedural abstraction allows a solution to a large problem to be based on the solutions of smaller subproblems. This is accomplished by creating procedures to solve each of the subproblems. | AAP-3.B.3 The subdivision of a computer program into separate subprograms is called modularity. | AAP-3.B.4 A procedural abstraction may extract shared features to generalize functionality instead of duplicating code. This allows for program code reuse, which helps manage complexity. | AAP-3.B.5 Using parameters allows procedures to be generalized, enabling the procedures to be reused with a range of input values or arguments. | AAP-3.B.6 Using procedural abstraction helps improve code readability. | AAP-3.B.7 Using procedural abstraction in a program allows programmers to change the internals of the procedure (to make it faster, more efficient, use less storage, etc.) without needing to notify users of the change as long as what the procedure does is preserved. | AAP-3.C.1
The exam reference sheet provides
Text: PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> } which is used to define a procedure that takes zero or more arguments. The procedure contains block of statements. |
AAP-3.C.2
The exam reference sheet provides
Text: PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> RETURN(expression) } which is used to define a procedure that takes zero or more arguments. The procedure contains block of statements and returns the value of expression. The RETURN statement may appear at any point inside the procedure and causes an immediate return from the procedure back to the calling statement. |
3.14 Libraries
DATES
TOPIC | 3.14 Libraries | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence. | ||||
LEARNING OBJECTIVE | AAP-3.D Select appropriate libraries or existing code segments to use in creating new programs.‚ 2.B | ||||
ESSENTIAL KNOWLEDGE | AAP-3.D.1 A software library contains procedures that may be used in creating new programs. | AAP-3.D.2 Existing code segments can come from internal or external sources, such as libraries or previously written code. | AAP-3.D.3 The use of libraries simplifies the task of creating complex programs. | AAP-3.D.4 Application program interfaces (APIs) are specifications for how the procedures in a library behave and can be used. | AAP-3.D.5 Documentation for an API/library is necessary in understanding the behaviors provided by the API/library and how to use them. |
3.15 Random Values
DATES
TOPIC | 3.15 Random Values | |
---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence | |
LEARNING OBJECTIVE | AAP-3.E
For generating random
values:
|
|
ESSENTIAL KNOWLEDGE | AAP-3.E.1
The exam reference sheet provides Text: RANDOM(a, b) which generates and returns a random integer from a to b, inclusive. Each result is equally likely to occur. For example, RANDOM(1, 3) could return 1, 2, or 3. |
AAP-3.E.2 Using random number generation in a program means each execution may produce a different result. |
3.16 Simulations
DATES
TOPIC | 3.16 Simulations | |||||||
---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence. | |||||||
LEARNING OBJECTIVE | AAP-3.F
For simulations:
|
|||||||
ESSENTIAL KNOWLEDGE | AAP-3.F.1 Simulations are abstractions of more complex objects or phenomena for a specific purpose. | AAP-3.F.2 A simulation is a representation that uses varying sets of values to reflect the changing state of a phenomenon. | AAP-3.F.3 Simulations often mimic real-world events with the purpose of drawing inferences, allowing investigation of a phenomenon without the constraints of the real world. | AAP-3.F.4 The process of developing an abstract simulation involves removing specific details or simplifying functionality. | AAP-3.F.5 Simulations can contain bias derived from the choices of real-world elements that were included or excluded. | AAP-3.F.6 Simulations are most useful when real-world events are impractical for experiments (e.g., too big, too small, too fast, too slow, too expensive, or too dangerous). | AAP-3.F.7 Simulations facilitate the formulation and refinement of hypotheses related to the objects or phenomena under consideration. | AAP-3.F.8 Random number generators can be used to simulate the variability that exists in the real world. |
3.17 Algorithmic Efficiency
DATES
TOPIC | 3.17 Algorithmic Efficiency | ||||||||
---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-4 There exist problems that computers cannot solve, and even when a computer can solve a problem, it may not be able to do so in a reasonable amount of time. | ||||||||
LEARNING OBJECTIVE | AAP-4.A
For determining the
efficiency of an algorithm:
|
||||||||
ESSENTIAL KNOWLEDGE | AAP-4.A.1 A problem is a general description of a task that can (or cannot) be solved algorithmically. An instance of a problem also includes specific input. For example, sorting is a problem; sorting the list (2,3,1,7) is an instance of the problem. | AAP-4.A.2 A decision problem is a problem with a yes/no answer (e.g., is there a path from A to B?). An optimization problem is a problem with the goal of finding the best solution among many (e.g., what is the shortest path from A to B?). | AAP-4.A.3 Efficiency is an estimation of the amount of computational resources used by an algorithm. Efficiency is typically expressed as a function of the size of the input. (no Big-O needed) | AAP-4.A.4 An algorithm's efficiency is determined through formal or mathematical reasoning. | AAP-4.A.5 An algorithm's efficiency can be informally measured by determining the number of times a statement or group of statements executes. | AAP-4.A.6 Different correct algorithms for the same problem can have different efficiencies. | AAP-4.A.7 Algorithms with a polynomial efficiency or slower (constant, linear, square, cube, etc.) are said to run in a reasonable amount of time. Algorithms with exponential or factorial efficiencies are examples of algorithms that run in an unreasonable amount of time. | AAP-4.A.8 Some problems cannot be solved in a reasonable amount of time because there is no efficient algorithm for solving them. In these cases, approximate solutions are sought. | AAP-4.A.9 A heuristic is an approach to a problem that produces a solution that is not guaranteed to be optimal but may be used when techniques that are guaranteed to always find an optimal solution are impractical. |
3.18 Undecidable Problems
DATES
TOPIC | 3.18 Undecidable Problems | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-4 There exist problems that computers cannot solve, and even when a computer can solve a problem, it may not be able to do so in a reasonable amount of time. | |||
LEARNING OBJECTIVE | AAP-4.B Explain the existence of undecidable problems in computer science.‚ 1.A | |||
ESSENTIAL KNOWLEDGE | AAP-4.B.1 A decidable problem is a decision problem for which an algorithm can be written to produce a correct output for all inputs (e.g., Is the number even?). | AAP-4.B.2 An undecidable problem is one for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer. | AAP-4.B.3 An undecidable problem may have some instances that have an algorithmic solution, but there is no algorithmic solution that could solve all instances of the problem. |
Activities
Sample Activities | Predict and compare Provide students with a list of expressions with assignments. Ask them to predict the value of each variable after the assignment and then compare their answers to the output produced when these statements are put into a program. |
---|---|
Using manipulatives When learning about conditionals, take a printout of a simple conditional statement and cut it into multiple sections. As students enter the classroom, hand them an envelope full of the paper strips, and ask them to reassemble the conditional in the proper order. |
|
Marking the text Provide students with program code that draws a square of side length 10 and a separate set of program code that uses side length 100. Ask students to mark up the sets of code to identify where they are different and to create a generalization by using parameters. Ask them to write a procedure that uses parameters to draw a square of any size. |
|
Think-pair-share Have students work in pairs to consider what factors would be the most important to prioritize in writing an algorithm to build the perfect master schedule for the school. Some considerations may include maximum class size, student preferences, and teacher availability. Have the pairs discuss and then report their results. Finally, discuss as a class how such programs may have to settle for a good enough solution when an exact solution may not be possible in a reasonable amount of time. |
CREATE TASK
DATES
Programming is a collaborative and creative process that brings ideas to life through the development of software. In the Create performance task, you will design and implement a program that might solve a problem, enable innovation, explore personal interests, or express creativity. Your submission must include the elements listed in the Submission Requirements section below. |
You are allowed to collaborate with your partner(s) on the development of the program only. The written response and the video that you submit for this performance task must be completed individually, without any collaboration with your partner(s) or anyone else. You can develop the code segments used in the written responses (parts 3b and 3c) with your partner(s) or on your own during the administration of the performance task. |
Please note that once this performance task has been assigned as an assessment for submission to College Board, you are expected to complete the task without assistance from anyone except for your partner(s) and then only when developing the program code. You must follow the Guidelines for Completing the Create Performance Task section below. |
Please Visit Collegeboard for up to date information on the create task. |
UNIT 4: Computer Systems and Networks
Overview
AP EXAM WEIGHTING | 11–16% |
CLASS PERIODS | ~14 |
OVERVIEW | The Internet is a network that most students use on a regular basis to look up information, to socialize with friends, and in many cases to complete their school work. In this big idea, students will learn how computer systems and networks, primarily the Internet, work. Students will learn about how information is transmitted on the Internet and about the safeguards that have been put in place to keep this system from breaking down. In addition, students will learn the effect that dividing tasks across multiple computing devices can have on the speed at which processes can occur. This big idea is often taught in conjunction with Big Idea 5: Impact of Computing. |
4.1 The Internet
DATES
TOPIC | 4.1 The Internet | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | CSN-1 Computer systems and networks facilitate the transfer of data. | |||
LEARNING OBJECTIVE | CSN-1.A Explain how computing devices work together in a network. 5.A | CSN-1.B Explain how the Internet works.‚ 5.A | CSN-1.C Explain how data are sent through the Internet via packets. 5.A | CSN-1.D Describe the differences between the Internet and the World Wide Web.‚ 5.A |
ESSENTIAL KNOWLEDGE |
|
|
|
4.2 Fault Tolerance
DATES
TOPIC | 4.2 Fault Tolerance | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | CSN-1 Computer systems and networks facilitate the transfer of data. | ||||||
LEARNING OBJECTIVE | CSN-1.E
For fault-tolerant systems, like the Internet:
|
||||||
ESSENTIAL KNOWLEDGE | CSN-1.E.1 The Internet has been engineered to be faulttolerant, with abstractions for routing and transmitting data. | CSN-1.E.2 Redundancy is the inclusion of extra components that can be used to mitigate failure of a system if other components fail. | CSN-1.E.3 One way to accomplish network redundancy is by having more than one path between any two connected devices. | CSN-1.E.4 If a particular device or connection on the Internet fails, subsequent data will be sent via a different route, if possible. | CSN-1.E.5 When a system can support failures and still continue to function, it is called fault-tolerant. This is important because elements of complex systems fail at unexpected times, often in groups, and fault tolerance allows users to continue to use the network. | CSN-1.E.6 Redundancy within a system often requires additional resources but can provide the benefit of fault tolerance. | CSN-1.E.7 The redundancy of routing options between two points increases the reliability of the Internet and helps it scale to more devices and more people. |
4.3 Parallel and Distributed Computing
DATES
TOPIC | 4.3Parallel and Distributed Computing | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | CSN-2 Parallel and distributed computing leverage multiple computers to more quickly solve complex problems or process large data sets. | |||||||||||
LEARNING OBJECTIVE | CSN-2.A
For sequential, parallel, and distributed computing:
|
CSN-2.B Describe benefits and challenges of parallel and distributed computing.‚ 1.D | ||||||||||
ESSENTIAL KNOWLEDGE | CSN-2.A.1 Sequential computing is a computational model in which operations are performed in order one at a time. | CSN-2.A.2 Parallel computing is a computational model where the program is broken into multiple smaller sequential computing operations, some of which are performed simultaneously. | CSN-2.A.3 Distributed computing is a computational model in which multiple devices are used to run a program. | CSN-2.A.4 Comparing efficiency of solutions can be done by comparing the time it takes them to perform the same task. | CSN-2.A.5 A sequential solution takes as long as the sum of all of its steps. | CSN-2.A.6 A parallel computing solution takes as long as its sequential tasks plus the longest of its parallel tasks. | CSN-2.A.7 The speedup of a parallel solution is measured in the time it took to complete the task sequentially divided by the time it took to complete the task when done in parallel. | CSN-2.B.1 Parallel computing consists of a parallel portion and a sequential portion. | CSN-2.B.2 Solutions that use parallel computing can scale more effectively than solutions that use sequential computing. | CSN-2.B.3 Distributed computing allows problems to be solved that could not be solved on a single computer because of either the processing time or storage needs involved | CSN-2.B.4 Distributed computing allows much larger problems to be solved quicker than they could be solved using a single computer. | CSN-2.B.5 When increasing the use of parallel computing in a solution, the efficiency of the solution is still limited by the sequential portion. This means that at some point, adding parallel portions will no longer meaningfully increase efficiency. |
Activities
Sample Activities | Journaling Ask students to read about the Internet and packet switching in Blown to Bits. Pose several prompts related to the Internet, such as the following, and have students add their answers to their journals:
|
---|---|
Predict and compare When introducing parallel and distributed computing, present students with a set of processes and several distributed models. Ask students to compare the models and predict which one is the most efficient, least efficient, or equivalent to other models in the set. Then show students how to determine the efficiency of each model to check if their predictions were correct. |
UNIT 5: Impact of Computing
AP EXAM WEIGHTING | 21–26% |
CLASS PERIODS | ~27 |
OVERVIEW | The creation of computer programs can have extensive impacts, some unintended, on societies, economies, and cultures. In this big idea, students explore these effects, the legal and ethical concerns that come with programs, and the responsibilities of programmers. When using computing innovations and transmitting information via the Internet, students should be aware of the risk of sharing personal identifiable information about themselves, such as their age or address, and actively take steps to keep this information safe. This big idea can be integrated throughout the course and works well with the Creative Development, Data, and Computing Systems and Networks big ideas. |
5.1 Beneficial and Harmful Effects
DATES
TOPIC | 5.1 Beneficial and Harmful Effects | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | IOC-1 While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences. | ||||||||||
LEARNING OBJECTIVE | IOC-1.A Explain how an effect of a computing innovation can be both beneficial and harmful. 5.C | IOC-1.B Explain how a computing innovation can have an impact beyond its intended purpose. 5.C | |||||||||
ESSENTIAL KNOWLEDGE | IOC-1.A.1 People create computing innovations. | IOC-1.A.2 The way people complete tasks often changes to incorporate new computing innovations. | IOC-1.A.3 Not every effect of a computing innovation is anticipated in advance. | IOC-1.A.4 A single effect can be viewed as both beneficial and harmful by different people, or even by the same person. | IOC-1.A.5 Advances in computing have generated and increased creativity in other fields, such as medicine, engineering, communications, and the arts. | IOC-1.B.1
Computing innovations can be used in ways that their creators had not originally intended:
|
IOC-1.B.2 Some of the ways computing innovations can be used may have a harmful impact on society, the economy, or culture. | IOC-1.B.3 Responsible programmers try to consider the unintended ways their computing innovations can be used and the potential beneficial and harmful effects of these new uses. | IOC-1.B.4 It is not possible for a programmer to consider all the ways a computing innovation can be used. | IOC-1.B.5 Computing innovations have often had unintended beneficial effects by leading to advances in other fields. | IOC-1.B.6 Rapid sharing of a program or running a program with a large number of users can result in significant impacts beyond the intended purpose or control of the programmer. |
5.2 Constructors
DATES
TOPIC | 5.2 Digital Divide | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | IOC-1 While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences. | ||||
LEARNING OBJECTIVE | IOC-1.C Describe issues that contribute to the digital divide. 5.C | ||||
ESSENTIAL KNOWLEDGE | IOC-1.C.1 Internet access varies between socioeconomic, geographic, and demographic characteristics, as well as between countries. | IOC-1.C.2 The digital divide refers to differing access to computing devices and the Internet, based on socioeconomic, geographic, or demographic characteristics. | IOC-1.C.3 The digital divide can affect both groups and individuals. | IOC-1.C.4 The digital divide raises issues of equity, access, and influence, both globally and locally | IOC-1.C.5 The digital divide is affected by the actions of individuals, organizations, and governments. |
5.3 Computing Bias
DATES
TOPIC | 5.3 Documentation with Comments | ||
---|---|---|---|
ENDURING UNDERSTANDING | IOC-1 While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences. | ||
LEARNING OBJECTIVE | IOC-1.D Explain how bias exists in computing innovations.‚ 5.E | ||
ESSENTIAL KNOWLEDGE | IOC-1.D.1 Computing innovations can reflect existing human biases because of biases written into the algorithms or biases in the data used by the innovation. | IOC-1.D.2 Programmers should take action to reduce bias in algorithms used for computing innovations as a way of combating existing human biases. | IOC-1.D.3 Biases can be embedded at all levels of software development. |
5.4 Crowdsourcing
DATES
TOPIC | 5.4 Crowdsourcing | |||||
---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | IOC-1 While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences. | |||||
LEARNING OBJECTIVE | IOC-1.E Explain how people participate in problem-solving processes at scale. 1.C | |||||
ESSENTIAL KNOWLEDGE | IOC-1.E.1 Widespread access to information and public data facilitates the identification of problems, development of solutions, and dissemination of results. | IOC-1.E.2 Science has been affected by using distributed and citizen science to solve scientific problems. | IOC-1.E.3 Citizen science is scientific research conducted in whole or part by distributed individuals, many of whom may not be scientists, who contribute relevant data to research using their own computing devices. | IOC-1.E.4 Crowdsourcing is the practice of obtaining input or information from a large number of people via the Internet. | IOC-1.E.5 Human capabilities can be enhanced by collaboration via computing. | IOC-1.E.6 Crowdsourcing offers new models for collaboration, such as connecting businesses or social causes with funding. |
5.5 Legal and Ethical Concerns
DATES
TOPIC | 5.5 Legal and Ethical Concerns |
---|---|
ENDURING UNDERSTANDING | IOC-1 While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences. |
LEARNING OBJECTIVE | IOC-1.F Explain how the use of computing can raise legal and ethical concerns., 5.E |
ESSENTIAL KNOWLEDGE |
|
5.6 Safe Computing
DATES
TOPIC | 5.6 Safe Computing | ||
---|---|---|---|
ENDURING UNDERSTANDING | IOC-2 The use of computing innovations may involve risks to personal safety and identity. | ||
LEARNING OBJECTIVE | IOC-2.A Describe the risks to privacy from collecting and storing personal data on a computer system.‚ 5.D | IOC-2.B Explain how computing resources can be protected and can be misused.‚ 5.E | IOC-2.C Explain how unauthorized access to computing resources is gained.‚ 5.E |
ESSENTIAL KNOWLEDGE |
|
|
|
Activities
Sample Activities | Marking the text Provide students with an article that highlights both beneficial and harmful effects of a specific computing innovation, and have them mark which effects are beneficial and which are harmful. For each effect the students mark as harmful, have them add notes about whether they think these effects should have been anticipated in advance. For each effect the students mark as beneficial, have the students make notes indicating if they think these benefits were intended or unintended. |
---|---|
Kinesthetic learning In small groups, have students create and act out a play or a scene involving privacy and security risks, especially when it comes to personally identifiable information (PII) and the impact of collecting such data. Sample topics might include not recognizing a phishing email, being careless with passwords, downloading a virus accidentally, or not being aware of a search history being kept on a computer. Students could extend their play to include best practices or ways to stay safer when using computing innovations. |
×
Teacher | Mr. Erik Wiessmann |
Subject | Computer Science |
edwiessmann@philasd.org | |
Cell Phone | 215.900.8742 |
School Phone | 215-351-7618 |
Course Description | This course is designed for all interested students in the field of Computer Science. Students will learn how to use common tools, and how to be responsible with technology. Students will then explore what it is like to create new tools as developers. |
Assessments | Students will be assessed on a variety of Projects, Written Assessments, and Formal Assessments. Students are required to participate during class time. |
School District Grading Policy | 10% Homework 20% Classwork (Point Reduction for: Unexcused Absence, Unexcused Late, Disrupt Class, Not Logging Out, Off Task) 30% Performance Based Learning 40% Tests |
Period Length (minutes) | 55 |
Materials List | Pen or Pencil for Writing Notebook for Journal Entries, Notes, and Constructive Response Questions |
Class Rules: | Students must obey the school wide rules of the Academy @ Palumbo at all times. |
Tutoring | After School Tuesday & Thursday 3:00-6:00 by appointment |
Classroom Website: | phillycomputerscience.com |
×
The Concept Outline | |
Applied Computer Technology | SDP is a Google School District. Google much like Apple, Microsoft and a host of other companies product lines allow their users to get much of their computer tasks done. Most packages include web browsers, word processors, spreadsheets, presentation tools, email, cloud storage, and many other tools. We will explore the google tools most High School students use today as well as look into alternative options and explore into other less known tools. |
Internet Safety & Ethics | Do you know how to keep yourself safe online? Are you paranoid, or putting too much information about yourself for the world to see? How aware are you that what you do online does matter? |
HTML/CSS | The past decade has connected people online to a once fictional level of communication. The World Wide Web is a front end to many of our online lives. Learning how to design and put together websites is a skill that all computer users may benifit from. HTML allows developers to write websites and CSS allows developers write beautiful websites. |
Javascript | Once a developer can represent themselves online with HTML and CSS they may then start writing websites that DO things. Javascript is a light yet powerful tool that may introduce students to the world of programming. |
GIMP | The Free & Open Source Image Editor This is the official website of the GNU Image Manipulation Program (GIMP). GIMP is a cross-platform image editor available for GNU/Linux, OS X, Windows and more operating systems. It is free software, you can change its source code and distribute your changes. Whether you are a graphic designer, photographer, illustrator, or scientist, GIMP provides you with sophisticated tools to get your job done. You can further enhance your productivity with GIMP thanks to many customization options and 3rd party plugins. |
Unity | Unity is so much more than the world’s best real-time development platform – it’s also a robust ecosystem designed to enable your success. Join our dynamic community of creators so you can tap into what you need to achieve your vision. |
Arduino | Arduino is an open-source hardware and software company, project and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices. Its products are licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL),[1] permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially in preassembled form or as do-it-yourself (DIY) kits. (wikipedia) |
×
TOPIC | Lesson | Assignment |
---|---|---|
Blockchain | https://www.youtube.com/watch?v=hYip_Vuv8J0 | Write a one page summary of what blockchiain is. How did the narrator connect with each audience. What level was most helpful for you? |
IP Address | https://www.youtube.com/watch?v=7_-qWlvQQtY | Find two other sources describing ip addresses and reference theses in your paper. Write a one page summary about how private your data is online based on what you have learned by researching ip addresses. |
Binary Math | https://www.youtube.com/watch?v=XKu_SEDAykw&t=1043s | Write a one page summary on the question that the engineer for google had to answer. Explain the problem and the stages of development the interview went over. Why is communication important? |
×
HTML/CSS
Overview
CLASS PERIODS | ~30 |
OVERVIEW | The past decade has connected people online to a once fictional level of communication. The World Wide Web is a front end to many of our online lives. Learning how to design and put together websites is a skill that all computer users may benifit from. HTML allows developers to write websites and CSS allows developers write beautiful websites. |
Essential Questions | HTML is a gateway to more abstract and powerful computer programming languages. CSS is a great way to create an abstract but powerful way to make websites beautiful |
HTML
DATES
Learning Objectives (Students will be able to ...) | Introduction • How the web works • Learning from other pages |
Structure • Understanding structure • Learning about markup • Tags and elements |
Text • Headings and paragraphs • Bold, italic, emphasis • Structural and semantic markup |
Lists • Numbered lists • Bullet lists • Definition lists |
Links • Creating links between pages • Linking to other sites • Email links |
Images • How to add images to pages • Choosing the right format • Optimizing images for the web |
Tables • How to create tables • What information suits tables • How to represent complex data in tables |
Forms • How to collect information from visitors • Different kinds of form controls • New HTML5 form controls |
Extra Markup • Specifying different versions of HTML • Identifying and grouping elements • Comments, meta information and iframes |
---|---|---|---|---|---|---|---|---|---|
Summary | • Brackets is the text editor we use • Github is where we store our websites |
•HTML pages are text documents. •HTML uses tags (characters that sit inside angled brackets) to give the information they surround special meaning. •Tags are often referred to as elements. •Tags usually come in pairs. The opening tag denotes the start of a piece of content; the closing tag denotes the end. •Opening tags can carry attributes, which tell us more about the content of that element. •Attributes require a name and a value. •To learn HTML you need to know what tags are available for you to use, what they do, and where they can go. |
•HTML elements are used to describe the structure of the page (e.g. headings, subheadings, paragraphs). •They also provide semantic information (e.g. where emphasis should be placed, the de nition of any acronyms used, when given text is a quotation). |
•There are three types of HTML lists: ordered, unordered, and definition. •Ordered lists use numbers. •Unordered lists use bullets. •Definition lists are used to de ne terminology. •Lists can be nested inside one another. |
•Links are created using the <a> element. •The <a> element uses the href attribute to indicate the page you are linking to. •If you are linking to a page within your own site, it is best to use relative links rather than quali ed URLs. •You can create links to open email programs with an email address in the "to" eld. •You can use the id attribute to target elements within a page that can be linked to. |
•The <img> element is used to add images to a web page. •You must always specify a src attribute to indicate the source of an image and an alt attribute to describe the content of an image. •You should save images at the size you will be using them on the web page and in the appropriate format. •Photographs are best saved as JPEGs; illustrations or logos that use at colors are better saved as GIFs. |
•The <table> element is used to add tables to a web page. •A table is drawn out row by row. Each row is created with the <tr> element. •Inside each row there are a number of cells represented by the <td> element (or <th> if it is a header). •You can make cells of a table span more than one row or column using the rowspan and colspan attributes. •For long tables you can split the table into a <thead>, <tbody>, and <tfoot>. |
•Whenever you want to collect information from visitors you will need a form, which lives inside a <form> element. •Information from a form is sent in name/value pairs. •Each form control is given a name, and the text the user types in or the values of the options they select are sent to the server. •HTML5 introduces new form elements which make it easier for visitors to ll in forms. |
•DOCTYPES tell browsers which version of HTML you are using. •You can add comments to your code between the <!-- and --> markers. •The id and class attributes allow you to identify particular elements. •The <div> and <span> elements allow you to group block-level and inline elements together. •<iframes> cut windows into your web pages through which other pages can be displayed. •The <meta> tag allows you to supply all kinds of information about your web page. •Escape characters are used to include special characters in your pages such as <, >, and ©. |
Tags | doctypes <!-- comments --> <head> <body> <title> | <h1><h2><h3><h4><h5><h6><p><b><i><sup><sub><br><hr><strong><em><blockquote><q><abbr><cite><dfn><address><ins><del><s> | <ol><li><ul><li><dl><dt><dd> | <a> [mailto:] [target] | <img> [scr][alt][title][height][width][align] | <table><tr><td><th><thead><tbody><tfoot> | <form>[action][method][id]<input>[type="..."][name][size][maxlength]<textarea><select><option><button><fieldset><legend> | doctypes<!-- comments --> <div><span><iframe><meta> | |
Assignments | Setup a github account | Write Hello World, tell me who you are. Tell me 3 favorite foods. 3 favorite bands. 3 favorite classes. And give me directions on how to make your favorite meal (get the instructions online, at the bottom of your page put the website you get the instructions from. | Put headings above each of your favorite things from the last assignment. Use the line break tag to seperate your text. Use the del tag to "cross off" one of your favorite things and replace it with a strong OR emphasis tag. Use the Horizontal Rule tag, make a new heading and call it math, then using superscript type out the pythagreon theorm, under the pythagreon theorm tell me if you like math or not. Use subscript and make your own citation with your food instructions. | Make your food list an ordered list. Make your other lists unordered lists. | Make a hyper-link to the food instructions. Hyper-link many of your other list items to relevant websites. Put a hyperlink to email you. This may be a fake email address. | Put a picture of yourself, or a picture that represents you on the page. This picture must be local. Put remote pictures to your favorites. When the picture is clicked on you must link to the origional page. | Make a new web page with your roster in a table. Link your two web pages together. | Make a new feedback form for your website. It should be linked from your origional site. You must use the radio buttons, checkboxes, text boxes, and drop down. Post to: <form action= "http://www.phillycomputerscience.com/post/formreturn.php" method="post"> | Add div and span Tags to your webpage. Give the tags name and id elements. |
CSS
DATES
Learning Objectives (Students will be able to ...) | Introducing CSS • What CSS does • How CSS works • Rules, properties, and values |
Colors • How to specify colors • Color terminology and contrast • Background color |
Text • Size and typeface of text • Bold, italics, capitals, underlines • Spacing between lines, words, and letters |
Boxes • Controlling size of boxes • Box model for borders, margin and padding • Displaying and hiding boxes |
Lists, tables and Forms • Specifying bullet point styles • Adding borders and backgrounds to tables • Changing the appearance of form elements |
Layout • Controlling the position of elements • Creating site layouts • Designing for different sized screens |
Images • Controlling size of images in CSS • Aligning images in CSS • Adding background images |
HTML 5 Layout • HTML5 layout elements • How old browsers understand new elements • Styling HTML5 layout elements with CSS |
Process & Design • How to approach building a site • Understanding your audience and their needs • How to present information visitors want to see |
Practical Information • Search engine optimization • Using analytics to understand visitors • Putting your site on the web |
---|---|---|---|---|---|---|---|---|---|---|
Summary | •CSS treats each HTML element as if it appears inside its own box and uses rules to indicate how that element should look. •Rules are made up of selectors (that specify the elements the rule applies to) and declarations (that indicate what these elements should look like). •Different types of selectors allow you to target your rules at different elements. •Declarations are made up of two parts: the properties of the element that you want to change, and the values of those properties. For example, the font-family property sets the choice of font, and the value arial speci es Arial as the preferred typeface. •CSS rules usually appear in a separate document, although they may appear within an HTML page. |
•Color not only brings your site to life, but also helps convey the mood and evokes reactions. •There are three ways to specify colors in CSS: RGB values, hex codes, and color names. •Color pickers can help you and the color you want. •It is important to ensure that there is enough contrast between any text and the background color (otherwise people will not be able to read your content). •CSS3 has introduced an extra value for RGB colors to indicate opacity. It is known as RGBA. •CSS3 also allows you to specify colors as HSL values, with an optional opacity value. It is known as HSLA. |
•There are properties to control the choice of font, size, weight, style, and spacing. •There is a limited choice of fonts that you can assume most people will have installed. •If you want to use a wider range of typefaces there are several options, but you need to have the right license to use them. •You can control the space between lines of text, individual letters, and words. Text can also be aligned to the left, right, center, or justi ed. It can also be indented. •You can use pseudo-classes to change the style of an element when a user hovers over or clicks on text, or when they have visited a link. |
•CSS treats each HTML element as if it has its own box. •You can use CSS to control the dimensions of a box. •You can also control the borders, margin and padding for each box with CSS. •It is possible to hide elements using the display and visibility properties. •Block-level boxes can be made into inline boxes, and inline boxes made into block-level boxes. •Legibility can be improved by controlling the width of boxes containing text and the leading. •CSS3 has introduced the ability to create image borders and rounded borders. |
•In addition to the CSS properties covered in other chapters which work with the contents of all elements, there are several others that are speci cally used to control the appearance of lists, tables, and forms. •List markers can be given different appearances using the list-style-type and list-style image properties. •Table cells can have different borders and spacing in different browsers, but there are properties you can use to control them and make them more consistent. •Forms are easier to use if the form controls are vertically aligned using CSS. •Forms bene t from styles that make them feel more interactive. |
•<div> elements are often used as containing elements to group together sections of a page. •Browsers display pages in normal ow unless you specify relative, absolute, or xed positioning. •The float property moves content to the left or right of the page and can be used to create multi-column layouts. (Floated items require a de ned width.) •Pages can be xed width or liquid (stretchy) layouts. •Designers keep pages within 960-1000 pixels wide, and indicate what the site is about within the top 600 pixels (to demonstrate its relevance without scrolling). •Grids help create professional and exible designs. X •CSS Frameworks provide rules for common tasks. X You can include multiple CSS les in one page. |
•You can specify the dimensions of images using CSS. This is very helpful when you use the same sized images on several pages of your site. •Images can be aligned both horizontally and vertically using CSS. •You can use a background image behind the box created by any element on a page. •Background images can appear just once or be repeated across the background of the box. •You can create image rollover effects by moving the background position of an image. •To reduce the number of images your browser has to load, you can create image sprites. |
•The new HTML5 elements indicate the purpose of different parts of a web page and help to describe its structure. •The new elements provide clearer code (compared with using multiple <div> elements). •Older browsers that do not understand HTML5 elements need to be told which elements are block-level elements. •To make HTML5 elements work in Internet Explorer 8 (and older versions of IE), extra JavaScript is needed, which is available free from Google. |
•It's important to understand who your target audience is, why they would come to your site, what information they want to nd and when they are likely to return. •Site maps allow you to plan the structure of a site. •Wireframes allow you to organize the information that will need to go on each page. •Design is about communication. Visual hierarchy helps visitors understand what you are trying to tell them. •You can differentiate between pieces of information using size, color, and style. •You can use grouping and similarity to help simplify the information you present. |
•Search engine optimization helps visitors nd your sites when using search engines. •Analytics tools such as Google •Analytics allow you to see how many people visit your site, how they nd it, and what they do when they get there. •To put your site on the web, you will need to obtain a domain name and web hosting. •FTP programs allow you to transfer les from your local computer to your web server. •Many companies provide platforms for blogging, email newsletters, e-commerce and other popular website tools (to save you writing them from scratch). |
Assignments | Link Your CSS file to your website | change font and background colors on your website. | Change fonts useing default and google fonts. Change font sizes | Change the width and height of your HTML elements. Add borders margins and padding. Make a new page with 50 div tags. Make css art. | Make your form beautiful! Make your roster beautiful. | Make a new html page with a poem. Using hover and graphics make your poem beautiful and interactive. | CSS Grid. Make a newspaper layout. | Make a nice menu. | Resize your window big and small. Ajust your page so that it always looks great. (400px-1200px) |
Applied Technology & Safety
Overview
CLASS PERIODS | ~20 |
OVERVIEW | SDP is a Google School District. Google much like Apple, Microsoft and a host of other companies product lines allow their users to get much of their computer tasks done. Most packages include web browsers, word processors, spreadsheets, presentation tools, email, cloud storage, and many other tools. We will explore the google tools most High School students use today as well as look into alternative options and explore into other less known tools. |
Essential Questions | How can we navigate a healthy and happy lifestyle while balancing our digital and non-digital life. |
DATES
Topic | Build Healthy Digital Habits | Avoid Online Scams | Evaluate Credibility of Online Sources | Understand Your Digital Footprint | Identify Cyberbullying | Create and Safeguard Passwords | Make Art in Google Sheets | If-Then Adventure Stories | Technology's Role in Current Events | Technology, Ethics, and Security | Technology at Work | Create an Editing Tool with Programming | Introduction to Machine Learning | |||||||||||||||||
Overview | In Build Healthy Digital Habits, students explore their digital habits and learn to achieve a balance between screen time and non-connected pursuits. This curriculum encourages students, teachers, families, and guardians to work together to define and balance technology’s role in daily life. Each lesson in this grouping stands alone, so you can choose any lesson out of the three to do with your class, or you can assign all three in sequence or in any order you choose. All students watch the introductory video together, then move on to the lesson you select for them. |
In Avoid Online Scams students analyze an online scam to identify warning signs and best practices for identifying and avoiding online scams to stay safe online. | In Evaluate Credibility of Online Sources, students search for an article online and use key questions to evaluate the credibility of its source. | In Understand Your Digital Footprint students will think about the actions they take online and create a visual picture of their digital footprint in Google Sheets. | In Identify Cyberbullying, students will collaborate with classmates in a document to create a plan to recognize and stop cyberbullying. | In Create and Safeguard Passwords, students discover how a hacker guesses passwords using a dictionary attack, then learn how to create and safeguard secure passwords. | In Make Art in Google Sheets, students will use conditional formatting rules to create a personalized pixel art project in Google Sheets. | In If-Then Adventure Stories, students create an interactive story in Google Slides. | In Technology’s Role in Current Events, students research a topic related to technology's role in current events, create a project, and present their findings. | In Technology, Ethics, and Security, students research a topic related to technology safety, create a project, and present their findings. | Students research a topic related to technology's role in the workplace, create a project, and present their findings. | In Create an Editing Tool with Programming, students use Script Editor to create an editing tool that highlights overused words and phrases in a document. | In Introduction to Machine Learning, students explore machine learning in four different ways: 1) by examining simulated data collected from a person driving their car, 2) by collecting data about people’s likes and dislikes in order to create an algorithm to predict future preferences, 3) by exploring how computers learn based on the data they receive, and 4) by considering the benefits and drawbacks of machine learning for real-world decision-making. |
GIMP
Overview
CLASS PERIODS | ~10 |
OVERVIEW | The Free & Open Source Image Editor
This is the official website of the GNU Image Manipulation Program (GIMP).
GIMP is a cross-platform image editor available for GNU/Linux, OS X, Windows and more operating systems. It is free software, you can change its source code and distribute your changes. Whether you are a graphic designer, photographer, illustrator, or scientist, GIMP provides you with sophisticated tools to get your job done. You can further enhance your productivity with GIMP thanks to many customization options and 3rd party plugins. |
Essential Questions | How to use creative tools to become more creative and enhance our Computer Science Experience. |
DATES
Essential Questions: | GIMP - The Free & Open Source Image Editor | ||||||
Enduring Understandings (Students will understand that ...) OBJECTIVES |
GIMP is a cross-platform image editor available for GNU/Linux, OS X, Windows and more operating systems. It is free software, you can change its source code and distribute your changes. Whether you are a graphic designer, photographer, illustrator, or scientist, GIMP provides you with sophisticated tools to get your job done. You can further enhance your productivity with GIMP thanks to many customization options and 3rd party plugins. |
||||||
Learning Objectives (Students will be able to ...) | Use GIMP for simple graphics needs without having to learn advanced image manipulation methods. |
Basic image and layer manipulation techniques. | How to create a circular-shaped image. | An introduction to using layer masks to modify the opacity of a layer. | Detailed conversion tutorial for generating a B&W result from a color image. | Using multiple layer masks to isolate specific tones in your image for editing. | Using high bit depth GIMP’s ‘Colors/Exposure’ operation to add exposure compensation to shadows and midtones while retaining highlight details. |
Summary | •Changing the Size (Dimensions) of an Image (Scale) •Changing the Size (Filesize) of a JPEG •Crop an Image •Rotate or Flip an Image |
This tutorial is intended to introduce you to a few simple commands, and some concepts in order to create a logo that appears to be floating above a background | There are no circular images. There are only rectangular images. But there can be images where corners are transparent, so that only a circle shows. | Layer masks are a fundamental tool in image manipulations. They allow you to selectively modify the opacity (transparency) of the layer they belong to. This differs from the use of the layer Opacity slider as a mask has the ability to selectively modify the opacity of different areas across a single layer. | Black and White photography is a big topic that deserves entire books devoted to the subject. In this lesson we are going to explore some of the most common methods for converting a color digital image into monochrome in GIMP. | Luminosity masks are basically layer masks that are built around specific tones in an image. They are derived from the image data itself, and focused on a specific range of tonal values. The benefit of using these types of masks is that when targeting tonal ranges the mask itself is self-feathering, helping to avoid problems with blending and hard transitions. | A very common editing problem is how to lighten the shadows and midtones of an image while retaining highlight details, a task sometimes referred to as “shadow recovery” and more generally speaking as “tone mapping”. This step-by-step tutorial shows you how to use high bit depth GIMP’s floating point “Colors/Exposure” operation to add one or more stops of positive exposure compensation to an image’s shadows and midtones while retaining highlight details. |
Resources and Materials: | https://www.gimp.org/ |
javascript
Overview
CLASS PERIODS | ~30 |
OVERVIEW | Once a developer can represent themselves online with HTML and CSS they may then start writing websites that DO things. Javascript is a light yet powerful tool that may introduce students to the world of programming. |
ESSENTIAL QUESTIONS | AAP-1
|
---|
Variables and Assignments
DATES
TOPIC | 3.1 Variables and Assignments | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-1 To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways. | ||||||
LEARNING OBJECTIVE | AAP-1.A Represent a value with a variable. 3.A | AAP-1.B Determine the value of a variable as a result of an assignment.‚ 4.B | |||||
ESSENTIAL KNOWLEDGE | AAP-1.A.1 A variable is an abstraction inside a program that can hold a value. Each variable has associated data storage that represents one value at a time, but that value can be a list or other collection that in turn contains multiple values. | AAP-1.A.2 Using meaningful variable names helps with the readability of program code and understanding of what values are represented by the variables. | AAP-1.A.3 Some programming languages provide types to represent data, which are referenced using variables. These types include numbers, Booleans, lists, and strings. | AAP-1.A.4 Some values are better suited to representation using one type of datum rather than another | AAP-1.B.1 The assignment operator allows a program to change the value represented by a variable. | AAP-1.B.2
The exam reference sheet provides the "←" operator to use for assignment. For example: a←expression evaluates expression and then assigns a copy of the result to the variable a. |
AAP-1.B.3
The value stored in a variable will be the most recent value assigned. For example: a←1 b←a a←2 display(b) still displays 1. |
Data Abstraction
DATES
TOPIC | 3.2 Data Abstraction | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-1 To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways. | |||||||||||
LEARNING OBJECTIVE | AAP-1.C Represent a list or string using a variable.‚ 3.A | AAP-1.D
For data abstraction:
|
||||||||||
ESSENTIAL KNOWLEDGE | AAP-1.C.1 A list is an ordered sequence of elements. For example, [value1, value2, value3, ...] describes a list where value1 is the first element, value2 is the second element, value3 is the third element, and so on. | AAP-1.C.2 An element is an individual value in a list that is assigned a unique index. | AAP-1.C.3 An index is a common method for referencing the elements in a list or string using natural numbers. | AAP-1.C.4 A string is an ordered sequence of characters. | AAP-1.D.1 Data abstraction provides a separation between the abstract properties of a data type and the concrete details of its representation. | AAP-1.D.2 Data abstractions manage complexity in programs by giving a collection of data a name without referencing the specific details of the representation. | AAP-1.D.3 Data abstractions can be created using lists. | AAP-1.D.4 Developing a data abstraction to implement in a program can result in a program that is easier to develop and maintain. | AAP-1.D.5 Data abstractions often contain different types of elements. | AAP-1.D.6 The use of lists allows multiple related items to be treated as a single value. Lists are referred to by different names, such as array, depending on the programming language. | AAP-1.D.7
The exam reference sheet provides the notation [value1, value2, value3, ...] to create a list with those values as the first, second, third, and so on items. For example,
|
AAP-1.D.8 The exam reference sheet describes a list structure whose index values are 1 through the number of elements in the list, inclusive. For all list operations, if a list index is less than 1 or greater than the length of the list, an error message is produced and the program will terminate. |
Mathematical Expressions
DATES
TOPIC | 3.3 Mathematical Expressions | ||
---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | ||
LEARNING OBJECTIVE | AAP-2.A Express an algorithm that uses sequencing without using a programming language.‚ 2.A | AAP-2.B Represent a step-by-step algorithmic process using sequential code statements. 2.B | AAP-2.C Evaluate expressions that use arithmetic operators.‚ 4.B |
ESSENTIAL KNOWLEDGE |
|
|
|
Strings
DATES
TOPIC | 3.4 Strings | |
---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |
LEARNING OBJECTIVE | AAP-2.D Evaluate expressions that manipulate strings.‚ 4.B | |
ESSENTIAL KNOWLEDGE | AAP-2.D.1 String concatenation joins together two or more strings end-to-end to make a new string. | AAP-2.D.2 A substring is part of an existing string. |
Boolean Expressions
DATES
TOPIC | 3.5 Boolean Expressions | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | ||||||
LEARNING OBJECTIVE | AAP-2.E
For relationships between two variables, expressions, or values:
|
AAP-2.F
For relationships between Boolean values:
|
|||||
ESSENTIAL KNOWLEDGE | AAP-2.E.1 A Boolean value is either true or false. | AAP-2.E.2
The exam reference sheet provides the following relational operators: =, ≠, >, <, ≥, and ≤. Text and Block:
|
AAP-2.F.1 The exam reference sheet provides the logical operators NOT, AND, and OR, which evaluate to a Boolean value. | AAP-2.F.2
The exam reference sheet provides Text: NOT condition which evaluates to true if condition is false; otherwise it evaluates to false. |
AAP-2.F.3
The exam reference sheet provides
Text: condition1 AND condition2 which evaluates to true if both condition1 and condition2 are true; otherwise it evaluates to false. |
AAP-2.F.4
The exam reference sheet provides
Text: condition1 OR condition2 which evaluates to true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true; otherwise it evaluates to false. |
AAP-2.F.5 The operand for a logical operator is either a Boolean expression or a single Boolean value. |
Conditionals
DATES
TOPIC | 3.6 Conditionals | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||
LEARNING OBJECTIVE | AAP-2.G Express an algorithm that uses selection without using a programming language.‚ 2.A | AAP-2.H
For selection:
|
||
ESSENTIAL KNOWLEDGE | AAP-2.G.1 Selection determines which parts of an algorithm are executed based on a condition being true or false. | AAP-2.H.1 Conditional statements, or if-statements, affect the sequential flow of control by executing different statements based on the value of a Boolean expression. | AAP-2.H.2
The exam reference sheet provides
Text: IF(condition) { <block of statements> } in which the code in block of statements is executed if the Boolean expression condition evaluates to true; no action is taken if condition evaluates to false. |
AAP-2.H.3
The exam reference sheet provides
Text: IF(condition) { <first block of statements> } ELSE { <second block of statements> } in which the code in first block of statements is executed if the Boolean expression condition evaluates to true; otherwise, the code in second block of statements is executed. |
Nested Conditionals
DATES
TOPIC | 3.7 Nested Conditionals | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | ENDURING UNDERSTANDING AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||
LEARNING OBJECTIVE | AAP-2.I
For nested selection:
|
|||
ESSENTIAL KNOWLEDGE | AAP-2.I.1 Nested conditional statements consist of conditional statements within conditional statements. |
Iteration
DATES
TOPIC | 3.8 Iteration | |||||
---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||||
LEARNING OBJECTIVE | AAP-2.J Express an algorithm that uses iteration without using a programming language.‚ 2.A | AAP-2.K
For iteration:
|
||||
ESSENTIAL KNOWLEDGE | AAP-2.J.1 Iteration is a repeating portion of an algorithm. Iteration repeats a specified number of times or until a given condition is met. | AAP-2.K.1 Iteration statements change the sequential flow of control by repeating a set of statements zero or more times, until a stopping condition is met. | AAP-2.K.2
The exam reference sheet provides Text: REPEAT n TIMES { <block of statements> } in which the block of statements is executed n times. |
AAP-2.K.3
The exam reference sheet provides Text: REPEAT UNTIL(condition) { <block of statements> } in which the code in block of statements is repeated until the Boolean expression condition evaluates to true. |
AAP-2.K.4 In REPEAT UNTIL(condition) iteration, an infinite loop occurs when the ending condition will never evaluate to true. | AAP-2.K.5 In REPEAT UNTIL(condition) iteration, if the conditional evaluates to true initially, the loop body is not executed at all, due to the condition being checked before the loop. |
Developing Algorithms
DATES
TOPIC | 3.9 Developing Algorithms | |||||||
---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||||||
LEARNING OBJECTIVE | AAP-2.L Compare multiple algorithms to determine if they yield the same side effect or result.‚ 1.D | AAP-2.M
For algorithms:
|
||||||
ESSENTIAL KNOWLEDGE | AAP-2.L.1 Algorithms can be written in different ways and still accomplish the same tasks. | AAP-2.L.2 Algorithms that appear similar can yield different side effects or results. | AAP-2.L.3 Some conditional statements can be written as equivalent Boolean expressions. | AAP-2.L.4 Some Boolean expressions can be written as equivalent conditional statements. | AAP-2.L.5 Different algorithms can be developed or used to solve the same problem. | AAP-2.M.1 Algorithms can be created from an idea, by combining existing algorithms, or by modifying existing algorithms. | AAP-2.M.2
Knowledge of existing algorithms can help in constructing new ones. Some existing algorithms include:
|
AAP-2.M.3 Using existing correct algorithms as building blocks for constructing another algorithm has benefits such as reducing development time, reducing testing, and simplifying the identification of errors. |
Lists
DATES
TOPIC | 3.10 Lists | ||||||
---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | ||||||
LEARNING OBJECTIVE | AAP-2.N
For list operations:
|
AAP-2.O
For algorithms involving
elements of a list:
|
|||||
ESSENTIAL KNOWLEDGE | AAP-2.N.1
The exam reference sheet provides basic operations on lists, including:
|
AAP-2.N.2 List procedures are implemented in accordance with the syntax rules of the programming language. | AAP-2.O.1 Traversing a list can be a complete traversal, where all elements in the list are accessed, or a partial traversal, where only a portion of elements are accessed. | AAP-2.O.2 Iteration statements can be used to traverse a list. | AAP-2.O.3
The exam reference sheet provides Text: FOR EACH item IN aList { <block of statements> } The variable item is assigned the value of each element of aList sequentially, in order, from the first element to the last element. The code in block of statements is executed once for each assignment of item. |
AAP-2.O.4
Knowledge of existing algorithms that use iteration can help in constructing new algorithms. Some examples of existing algorithms that are often used with lists include:
|
AAP-2.O.5 Linear search or sequential search algorithms check each element of a list, in order, until the desired value is found or all elements in the list have been checked. |
Binary Search
DATES
TOPIC | 3.11 Binary Search | ||
---|---|---|---|
ENDURING UNDERSTANDING | AAP-2 The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | ||
LEARNING OBJECTIVE | AAP-2.P
For binary search algorithms:
|
||
ESSENTIAL KNOWLEDGE | AAP-2.P.1 The binary search algorithm starts at the middle of a sorted data set of numbers and eliminates half of the data; this process repeat until the desired value is found or all elements have been eliminated. | AAP-2.P.2 Data must be in sorted order to use the binary search algorithm. | AAP-2.P.3 Binary search is often more efficient than sequential/linear search when applied to sorted data. |
Calling Procedures
DATES
TOPIC | 3.12 Calling Procedures | ||||||||
---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence. | ||||||||
LEARNING OBJECTIVE | AAP-3.A
For procedure calls:
| ||||||||
ESSENTIAL KNOWLEDGE | AAP-3.A.1 A procedure is a named group of programming instructions that may have parameters and return values. | AAP-3.A.2 Procedures are referred to by different names, such as method or function, depending on the programming language. | AAP-3.A.3 Parameters are input variables of a procedure. Arguments specify the values of the parameters when a procedure is called. | AAP-3.A.4 A procedure call interrupts the sequential execution of statements, causing the program to execute the statements within the procedure before continuing. Once the last statement in the procedure (or a return statement) has executed, flow of control is returned to the point immediately following where the procedure was called. | AAP-3.A.5
The exam reference sheet provides procName(arg1, arg2, ...) as a way to call Text: PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> } which takes zero or more arguments; arg1 is assigned to parameter1, arg2 is assigned to parameter2, and so on. |
AAP-3.A.6
The exam reference sheet provides the procedure Text: DISPLAY(expression) Block: to display the value of expression, followed by a space. |
AAP-3.A.7
The exam reference sheet provides the
Text: RETURN(expression) statement, which is used to return the flow of control to the point where the procedure was called and to return the value of expression. |
AAP-3.A.8
The exam reference sheet provides result←procName(arg1, arg2, ...) to assign to result the value of the procedure being returned by calling Text: PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> RETURN(expression) } |
AAP-3.A.9
The exam reference sheet provides procedure
Text: INPUT() which accepts a value from the user and returns the input value. |
Developing Procedures
DATES
TOPIC | 3.13 Developing Procedures | ||||||||
---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence | ||||||||
LEARNING OBJECTIVE | AAP-3.B Explain how the use of procedural abstraction manages complexity in a program.‚ 3.C | AAP-3.C Develop procedural abstractions to manage complexity in a program by writing procedures.‚ 3.B | |||||||
ESSENTIAL KNOWLEDGE | AAP-3.B.1 One common type of abstraction is procedural abstraction, which provides a name for a process and allows a procedure to be used only knowing what it does, not how it does it. | AAP-3.B.2 Procedural abstraction allows a solution to a large problem to be based on the solutions of smaller subproblems. This is accomplished by creating procedures to solve each of the subproblems. | AAP-3.B.3 The subdivision of a computer program into separate subprograms is called modularity. | AAP-3.B.4 A procedural abstraction may extract shared features to generalize functionality instead of duplicating code. This allows for program code reuse, which helps manage complexity. | AAP-3.B.5 Using parameters allows procedures to be generalized, enabling the procedures to be reused with a range of input values or arguments. | AAP-3.B.6 Using procedural abstraction helps improve code readability. | AAP-3.B.7 Using procedural abstraction in a program allows programmers to change the internals of the procedure (to make it faster, more efficient, use less storage, etc.) without needing to notify users of the change as long as what the procedure does is preserved. | AAP-3.C.1
The exam reference sheet provides
Text: PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> } which is used to define a procedure that takes zero or more arguments. The procedure contains block of statements. |
AAP-3.C.2
The exam reference sheet provides
Text: PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> RETURN(expression) } which is used to define a procedure that takes zero or more arguments. The procedure contains block of statements and returns the value of expression. The RETURN statement may appear at any point inside the procedure and causes an immediate return from the procedure back to the calling statement. |
Libraries
DATES
TOPIC | 3.14 Libraries | ||||
---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence. | ||||
LEARNING OBJECTIVE | AAP-3.D Select appropriate libraries or existing code segments to use in creating new programs.‚ 2.B | ||||
ESSENTIAL KNOWLEDGE | AAP-3.D.1 A software library contains procedures that may be used in creating new programs. | AAP-3.D.2 Existing code segments can come from internal or external sources, such as libraries or previously written code. | AAP-3.D.3 The use of libraries simplifies the task of creating complex programs. | AAP-3.D.4 Application program interfaces (APIs) are specifications for how the procedures in a library behave and can be used. | AAP-3.D.5 Documentation for an API/library is necessary in understanding the behaviors provided by the API/library and how to use them. |
Random Values
DATES
TOPIC | 3.15 Random Values | |
---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence | |
LEARNING OBJECTIVE | AAP-3.E
For generating random
values:
|
|
ESSENTIAL KNOWLEDGE | AAP-3.E.1
The exam reference sheet provides Text: RANDOM(a, b) which generates and returns a random integer from a to b, inclusive. Each result is equally likely to occur. For example, RANDOM(1, 3) could return 1, 2, or 3. |
AAP-3.E.2 Using random number generation in a program means each execution may produce a different result. |
Simulations
DATES
TOPIC | 3.16 Simulations | |||||||
---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-3 Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence. | |||||||
LEARNING OBJECTIVE | AAP-3.F
For simulations:
|
|||||||
ESSENTIAL KNOWLEDGE | AAP-3.F.1 Simulations are abstractions of more complex objects or phenomena for a specific purpose. | AAP-3.F.2 A simulation is a representation that uses varying sets of values to reflect the changing state of a phenomenon. | AAP-3.F.3 Simulations often mimic real-world events with the purpose of drawing inferences, allowing investigation of a phenomenon without the constraints of the real world. | AAP-3.F.4 The process of developing an abstract simulation involves removing specific details or simplifying functionality. | AAP-3.F.5 Simulations can contain bias derived from the choices of real-world elements that were included or excluded. | AAP-3.F.6 Simulations are most useful when real-world events are impractical for experiments (e.g., too big, too small, too fast, too slow, too expensive, or too dangerous). | AAP-3.F.7 Simulations facilitate the formulation and refinement of hypotheses related to the objects or phenomena under consideration. | AAP-3.F.8 Random number generators can be used to simulate the variability that exists in the real world. |
Algorithmic Efficiency
DATES
TOPIC | 3.17 Algorithmic Efficiency | ||||||||
---|---|---|---|---|---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-4 There exist problems that computers cannot solve, and even when a computer can solve a problem, it may not be able to do so in a reasonable amount of time. | ||||||||
LEARNING OBJECTIVE | AAP-4.A
For determining the
efficiency of an algorithm:
|
||||||||
ESSENTIAL KNOWLEDGE | AAP-4.A.1 A problem is a general description of a task that can (or cannot) be solved algorithmically. An instance of a problem also includes specific input. For example, sorting is a problem; sorting the list (2,3,1,7) is an instance of the problem. | AAP-4.A.2 A decision problem is a problem with a yes/no answer (e.g., is there a path from A to B?). An optimization problem is a problem with the goal of finding the best solution among many (e.g., what is the shortest path from A to B?). | AAP-4.A.3 Efficiency is an estimation of the amount of computational resources used by an algorithm. Efficiency is typically expressed as a function of the size of the input. (no Big-O needed) | AAP-4.A.4 An algorithm's efficiency is determined through formal or mathematical reasoning. | AAP-4.A.5 An algorithm's efficiency can be informally measured by determining the number of times a statement or group of statements executes. | AAP-4.A.6 Different correct algorithms for the same problem can have different efficiencies. | AAP-4.A.7 Algorithms with a polynomial efficiency or slower (constant, linear, square, cube, etc.) are said to run in a reasonable amount of time. Algorithms with exponential or factorial efficiencies are examples of algorithms that run in an unreasonable amount of time. | AAP-4.A.8 Some problems cannot be solved in a reasonable amount of time because there is no efficient algorithm for solving them. In these cases, approximate solutions are sought. | AAP-4.A.9 A heuristic is an approach to a problem that produces a solution that is not guaranteed to be optimal but may be used when techniques that are guaranteed to always find an optimal solution are impractical. |
Undecidable Problems
DATES
TOPIC | 3.18 Undecidable Problems | |||
---|---|---|---|---|
ENDURING UNDERSTANDING | AAP-4 There exist problems that computers cannot solve, and even when a computer can solve a problem, it may not be able to do so in a reasonable amount of time. | |||
LEARNING OBJECTIVE | AAP-4.B Explain the existence of undecidable problems in computer science.‚ 1.A | |||
ESSENTIAL KNOWLEDGE | AAP-4.B.1 A decidable problem is a decision problem for which an algorithm can be written to produce a correct output for all inputs (e.g., Is the number even?). | AAP-4.B.2 An undecidable problem is one for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer. | AAP-4.B.3 An undecidable problem may have some instances that have an algorithmic solution, but there is no algorithmic solution that could solve all instances of the problem. |
Activities
Sample Activities | Predict and compare Provide students with a list of expressions with assignments. Ask them to predict the value of each variable after the assignment and then compare their answers to the output produced when these statements are put into a program. |
---|---|
Using manipulatives When learning about conditionals, take a printout of a simple conditional statement and cut it into multiple sections. As students enter the classroom, hand them an envelope full of the paper strips, and ask them to reassemble the conditional in the proper order. |
|
Marking the text Provide students with program code that draws a square of side length 10 and a separate set of program code that uses side length 100. Ask students to mark up the sets of code to identify where they are different and to create a generalization by using parameters. Ask them to write a procedure that uses parameters to draw a square of any size. |
|
Think-pair-share Have students work in pairs to consider what factors would be the most important to prioritize in writing an algorithm to build the perfect master schedule for the school. Some considerations may include maximum class size, student preferences, and teacher availability. Have the pairs discuss and then report their results. Finally, discuss as a class how such programs may have to settle for a good enough solution when an exact solution may not be possible in a reasonable amount of time. |
Arduino
Overview
CLASS PERIODS | ~10 |
OVERVIEW | Arduino is an open-source hardware and software company, project and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices. Its products are licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL),[1] permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially in preassembled form or as do-it-yourself (DIY) kits. (wikipedia) |
Essential Questions | Lesson Plans Coming Soon... |
DATES
Unity
Overview
CLASS PERIODS | ~20 |
OVERVIEW | Unity is so much more than the world's best real-time development platform it's also a robust ecosystem designed to enable your success. Join our dynamic community of creators so you can tap into what you need to achieve your vision. |
Essential Questions | Lesson Plans Coming Soon... |
DATES
×
Propositional Logic
http://intrologic.stanford.edu/public/index.php
Introduction
Enduring Understandings (Students will understand that ...)
OBJECTIVES |
Introduction | |||||||
We use Logic in just about everything we do. We use the language of Logic to state observations, to define concepts, and to formalize theories. We use logical reasoning to derive conclusions from these bits of information. We use logical proofs to convince others of our conclusions. | ||||||||
Learning Objectives (Students will be able to ...)
|
Introduction | Sorority World | Logical Sentences | Logical Entailment | Logical Proofs | Formalization | Automation | Reading Guide |
use the language of Logic to state observations, to define concepts, and to formalize theories. | decode logic problems | make sentences true from a table | make logical conclusions | prove conclusions from logical sentences | write sentences in the languae of logic | process the complexities of logic through machines | preview the course | |
General and Domain Specific Vocabulary Words: | Contrapositive, Converse, Inverse | Logical Entailment | Abduction, Analogy, Deduction, Induction | Propositional Logic | Herbrand Logic, Relational Logic |
Propositional Logic
Enduring Understandings (Students will understand that ...)
OBJECTIVES |
Propositional Logic | ||||||
Propositional Logic is the logic of propositions. Symbols in the language represent "conditions" in the world, and complex sentences in the language express interrelationships among these conditions. The primary operators are Boolean connectives, such as and, or, and not. | |||||||
Learning Objectives (Students will be able to ...)
|
Introduction | Syntax | Semantics | Evaluation | Satisfaction | Natural Language | Digital Circuits |
write simple and complex logic questions | write abstract truth statements | evaluate truth statements in the formal language of logic | write sentences from truth tables | encoding of various English sentences as formal sentences in Propositional Logic. | write logical sentences with computer gates. | ||
General and Domain Specific Vocabulary Words: | Proposition, Propositional Logic | Implication, Biconditional, Conjunction, Implication, Disjunction, Implication, Proposition Constant, Negation, Operator Precedence, Proposition Constant, Propositional Language, Propositional Sentence, Propositional Vocabulary, Propositional Sentence, Negation | Implication, Biconditional, Conjunction, Implication, Disjunction, Implication, Negation, Negation, Truth Assignment | Proof, Truth Table |
Propositional Analysis
Enduring Understandings (Students will understand that ...)
OBJECTIVES |
Propositional Analysis | |||||
Satisfaction is a relationship between specific sentences and specific truth assignments. In Logic, we are usually more interested in properties and relationships of sentences that hold across all truth assignments. | ||||||
Learning Objectives (Students will be able to ...)
|
Introduction | Logical Properties | Logical Equivalence | Logical Entailment | Logical Consistency | Properties and Relationships |
write logical statements following specific rules | read sentences and decide if they are equivilant | define if a sentence φ logically entails a sentence ψ | write a sentence φ that is consistent with a sentence ψ if and only if there is a truth assignment that satisfies both φ and ψ. | review statements from the chapter | ||
General and Domain Specific Vocabulary Words: | Validity, Contingency, Falsifiability, Satisfaction, Unsatisfiability | Logical Entailment, Logical Equivalence, Satisfaction | Satisfaction | Logical Consistency | Consistency Theorem, Deduction Theorem, Equivalence Theorem, Unsatisfiability Theorem |
Propositional Proofs
Propositional Proofs | |||||
Checking logical entailment with truth tables has the merit of being conceptually simple. However, it is not always the most practical method. The number of truth assignments of a language grows exponentially with the number of logical constants. When the number of logical constants in a propositional language is large, it may be impossible to process its truth table. | |||||
Introduction | Linear Reasoning | Hypothetical Reasoning | Fitch | Reasoning Tips | Soundness and Completeness |
write out correct rules of inference | read and write Structured proofs | be able to write proofs using the ten rules of inference | be able to write proofs using the ten rules of inference | be able to write proofs using the ten rules of inference | |
Rule of Inference, Instance, Linear Proof, Rule of Inference, Proof, Rule of Inference, Satisfiability | Assumption, Proof, Structured Proof | And Elimination, And Introduction, Biconditional Elimination, Biconditional Introduction, Fitch System, Implication Elimination, Implication Introduction, Negation Elimination, Negation Introduction, Or Elimination, Or Introduction | Completeness, Provability, Soundness |
Propositional Resolution
Enduring Understandings (Students will understand that ...)
OBJECTIVES |
Propositional Resolution | |||
Propositional Resolution is a powerful rule of inference for Propositional Logic. Using Propositional Resolution (without axiom schemata or other rules of inference), it is possible to build a theorem prover that is sound and complete for all of Propositional Logic. What's more, the search space using Propositional Resolution is much smaller than for standard Propositional Logic. | ||||
Learning Objectives (Students will be able to ...)
|
Introduction | Clausal Form | Resolution Principle | Resolution Reasoning |
write statements in their proper forms | derive more complecated proofs | resolve certain logical thoughts | ||
General and Domain Specific Vocabulary Words: | Schema | Reiteration |
×
Relational Logic
http://intrologic.stanford.edu/public/index.php
Relational Logic
Enduring Understandings (Students will understand that ...)
OBJECTIVES |
Relational Logic | ||||||||||
Relational Logic expands upon Propositional Logic by providing a means for explicitly talking about individual objects and their interrelationships (not just monolithic conditions). In order to do so, we expand our language to include object constants and relation constants, variables and quantifiers. | |||||||||||
Learning Objectives (Students will be able to ...)
|
Introduction | Syntax | Semantics | Evaluation | Satisfaction | Sorority World | Blocks World | Modular Arithmetic | Logical Properties | Logical Entailment | Relational Logic and Propositional Logic |
state all of the components of a logical sentence | follow the rules when using relational logic | evaluate logical structures | create and read relational logic truth tables | write relational sentences as truth tables, english sentences, logical statements | write relational sentences as truth tables, english sentences, logical statements | define finite sets of statements | recognize valid and invalid statements | valididate logical worlds as true or false | write relational statemetns as propostiional statements | ||
General and Domain Specific Vocabulary Words: | Relational Logic |
Relational Analysis
Enduring Understandings (Students will understand that ...)
OBJECTIVES |
Relational Analysis | ||||
In Relational Logic, it is possible to analyze the properties of sentences in much the same way as in Propositional Logic. Given a sentence, we can determine its validity, satisfiability, and so forth by looking at possible truth assignments. And we can confirm logical entailment or logical equivalence of sentences by comparing the truth assignments that satisfy them and those that don't. | |||||
Learning Objectives (Students will be able to ...)
|
Introduction | Truth Tables | Semantic Trees | Boolean Models | Non-Boolean Models |
Build a relational logic truth table | build several visual elements for a logical world | build several visual elements for a logical world | build several visual elements for a logical world | ||
General and Domain Specific Vocabulary Words: |
Relational Proofs
Enduring Understandings (Students will understand that ...)
OBJECTIVES |
Relational Proofs | ||||
As with Propositional Logic, we can demonstrate logical entailment in Relational Logic by writing proofs. As with Propositional Logic, it is possible to show that a set of Relational Logic premises logically entails a Relational Logic conclusion if and only if there is a finite proof of the conclusion from the premises. Moreover, it is possible to find such proofs in a finite time. | |||||
Learning Objectives (Students will be able to ...)
|
Introduction | Rules for Universal Quantifiers | Rules for Existential Quantifiers | Domain Closure | Example |
reason from general statements to specific ones | write a Skolem term | write a proof with Domain Closure | write complete relational proofs | ||
General and Domain Specific Vocabulary Words: |
×
Herbrand Logic
http://intrologic.stanford.edu/public/index.php
Herbrand Logic
Enduring Understandings (Students will understand that ...) OBJECTIVES |
Herbrand Logic | |||||||
In this lesson, we explore an alternative to Relational Logic, called Herbrand Logic, in which we can name infinitely many objects with a finite vocabulary. The trick is to expand our language to include not just object constants but also complex terms that can be built from object constants in infinitely many ways. By constructing terms in this way, we can get infinitely many names for objects; and, because our vocabulary is still finite, we can finitely axiomatize some things in a way that would not be possible with infinitely many object constants. | ||||||||
Learning Objectives (Students will be able to ...) | Introduction | Syntax and Semantics | Evaluation and Satisfaction | Peano Arithmetic | Linked Lists | Pseudo English | Metalevel Logic | Undecidability |
Essential Knowledge (Students will know who to ...) |
write a logic statement with the new tools: function constants and functional expressions | Using symbolic reasoning proof statements as valid | use Peano arithmetic in logic statements | traverse and manipulate linked lists | write full statements in pseudo english following all rules of the language | formalize logic with logic | recognize that we can not prove everything with Herbrand logic | |
General and Domain Specific Vocabulary Words: | Herbrand Logic |
Herbrand Proofs
Enduring Understandings (Students will understand that ...) OBJECTIVES |
Herbrand Proofs | |
In this lesson, we talk about the non-compactness of Herbrand Logic and the loss of completeness in our proof procedure. In the next lesson, we look at an extension to Fitch, called Induction, that allows us to prove more results in Herbrand Logic. | ||
Learning Objectives (Students will be able to ...) | Introduction | Non-Compactness and Incompleteness |
Essential Knowledge (Students will know who to ...) |
||
General and Domain Specific Vocabulary Words: |
Induction
Enduring Understandings (Students will understand that ...) OBJECTIVES |
Induction | ||||||
Herbrand Logic takes us one step further by providing a means for describing worlds with infinitely many objects. The resulting logic is much more powerful than Propositional Logic and Relational Logic. Unfortunately, as we shall see, many of the nice computational properties of the first two logics are lost as a result. | |||||||
Learning Objectives (Students will be able to ...) | Introduction | Domain Closure | Linear Induction | Tree Induction | Structural Induction | Multidimensional Induction | Embedded Induction |
Essential Knowledge (Students will know who to ...) |
solve finite logic problems | solve logic proofs using linear induction | solve logic proofs using tree induction | solve logic proofs using structural induction | solve logic proofs using Multidimensional induction | solve logic proofs using Embedded Induction | |
General and Domain Specific Vocabulary Words: |
Resolution
Enduring Understandings (Students will understand that ...) OBJECTIVES |
Resolution | ||||||||
The Resolution Principle is a rule of inference for Relational Logic analogous to the Propositional Resolution Principle for Propositional Logic. Using the Resolution Principle alone (without axiom schemata or other rules of inference), it is possible to build a reasoning program that is sound and complete for all of Relational Logic. The search space using the Resolution Principle is smaller than the search space for generating Herbrand proofs. | |||||||||
Learning Objectives (Students will be able to ...) | Introduction | Clausal Form | Unification | Resolution Principle | Resolution Reasoning | Unsatisfiability | Logical Entailment | Answer Extraction | Strategies |
Essential Knowledge (Students will know who to ...) |
Write proofs with a few additional rules to deal with the presence of variables and quantifiers. | Solve logic proofs by unifying statements | Solve logic proofs by unifying statements | Use Relational Resolution to derive the clause | proove that a statement is unsatisfialbe | use defined strategies to help solve complex logic proofs | |||
General and Domain Specific Vocabulary Words: |
×
Materials
course homepage | http://intrologic.stanford.edu/homepage/index.html |
Satisfiability | http://intrologic.stanford.edu/extras/satisfiability.html |
Equality | http://intrologic.stanford.edu/extras/equality.html |
First-Order Logic | http://intrologic.stanford.edu/extras/fol.html |
Herbrand Manifesto | http://intrologic.stanford.edu/extras/manifesto.html |
River Crossing Problems | http://brainden.com/crossing-river.htm |
Logic Card Trick | https://www.rd.com/culture/logical-card-trick/ |
Innovative Thinking | https://www.vanderbilt.edu/olli/class-materials/InnovativeThinkingSession1.pdf |
Everyday Algorithms | http://db.cs.duke.edu/courses/summer04/cps001/labs/plab2.html |