Table of Contents
Session 2 | Session 4 |
@TeachCode
Virtual Professional Learning Program Summer 2022
Computer Science Principles
As you enter:
Module 1
Introduction to CSP
Pin your hometown
Drag a Code.org logo to the chart below to share how long you have been an Educator
1-5 6-10 11-15 16-20 25+
Number of Years
Drag a Code.org logo to the chart below to share how long you have taught Computer Science
1 2 3 4 5 6 7 8+
Number of Years
Have you taught AP CSA previously?
Yes
No
@TeachCode
Session 1
Welcome to
the Workshop!
Who’s in the Room?
Who’s in the room?
@TeachCode
Katie Ingram
Taft Charter High School
AP CSP/AP CSA Facilitator
Insert Pic (optional)
Hope Yamada
Facilitator since 2017 (CS F/D/P/A)
Teaching computer related courses K-14 since 2001
@TeachCode
Get to know the people at your “table”!
Getting to Know One Another
You have six minutes to introduce yourself to the people in your breakout room. Share anything you like about who you are and why you’re here!
@TeachCode
Norms
Norms
To help us create a productive and respectful space that is conducive to learning together, we propose the following norms:
@TeachCode
Program Overview
Program Overview
Code.org’s “Why”
Code.org’s vision for CS education: “every student in every school has the opportunity to learn computer science as part of the their core K-12 education”
@TeachCode
Code.org’s “Why”
Achieving equity in CS education requires that:
@TeachCode
Code.org’s “Why”
@TeachCode
Code.org’s “Why”
Why does Code.org approach its work through the lens of equity?
@TeachCode
Code.org’s “Why”
The most important part of this work is YOU!
Educators play a vital role in supporting equity in CS education, so we have focused our energies on building equity-focused CS curricula and professional learning experiences to support YOU in all this work!
@TeachCode
Program at a Glance
Summer workshop | Ongoing Support | |
Summer 2022 | September 2022 - May 2023 | Summer 2023 |
5 days in-person |
| 2-Day Capstone |
@TeachCode
Program at a Glance
@TeachCode
Teal | Lesson Exploration |
Orange | Presentations |
Purple | Discussion |
Green | Asynchronous |
@TeachCode
Introduction to Model Lessons
Teacher - One of the facilitators will act as the “teacher” of a lesson. |
Learner - This group acts in the role of “learners” of the lesson |
Observer - The other facilitator “observes” the lesson and leads a discussion after the modeled lesson |
Just a note…
If you attended Code.org PD in the past you may have taught a lesson in a group. We are not doing that for this PD.
@TeachCode
Our Equity Framework
UNDERSTANDING SELF
How do my experiences, identity, and beliefs shape how I see the world and my role as a CS teacher?
MAKING AND PURSUING A COMMITMENT
What will I commit to in support of equity? How will I know I’m making progress toward that goal? What support will I need from �my community?
UNDERSTANDING CONTEXT
Who has access to CS in my community? What are the demographics of our CS classrooms? Who feels included in those classrooms?
UNDERSTANDING BARRIERS AND OPPORTUNITIES
What challenges stand in my way? And what strategies can I use to overcome those barriers to effect change in support of equity?
UNDERSTANDING RESPONSIBILITY
Given my role and my power, what responsibility do I have to effect change in support of equity?
Cycle of equity-focused development stages
@TeachCode
Question Parking Lot
Be sure to utilize our Question Parking Lot throughout the week!
@TeachCode
High-Level Overview:
Introducing Java Lab
@TeachCode
What Do We Mean By “High Level Overview”?
Introduction to Java Lab
Java Lab: Our Section Code: HCRXMD
Do This:
As you explore, consider:
@TeachCode
Java Lab Tour
Tour of Java Lab IDE:
@TeachCode
Java Lab Tour
Other items to remember:
The fine print: Frequently the main method will be provided to you and you do not need to know the exact syntax for the main method for the AP exam.
@TeachCode
Unit 1 Lesson 2 - Activity
Java Syntax Rules (a summary)
@TeachCode
@TeachCode
Unit 1 Overview
@TeachCode
Unit 1 Overview
@TeachCode
Up next… a Model Lesson
@TeachCode
Model Lesson Process
What to Expect: Model Lesson details
Model Lesson is an opportunity for you to fully engage as a learner in the lesson
Afterward, an “Observer” facilitates a discussion, or debrief of the lesson that was modeled.
Teacher - This will be one of the facilitators |
Learner - This group acts in the role of student |
Observer - The facilitator observes the lesson and leads a discussion after the modeled lesson |
@TeachCode
Model Lesson #1:
U1L3 - The Neighborhood
@TeachCode
Unit 1 - Lesson 3
The Neighborhood
Warm Up
Do This: On page 4 of your Activity Packet, draw a house.
Unit 1 Lesson 3 - Warm Up
CSA
Hold your drawing up to your camera!
Unit 1 Lesson 3 - Warm Up
CSA
Prompt
What elements does everyone's house have in common?
Unit 1 Lesson 3 - Warm Up
What information might we include if we were to create a blueprint for what all houses should have?
CSA
Activity
Lesson Objectives
Unit 1 Lesson 3 - Activity
CSA
Object-Oriented Programming
As you watch the video, keep an eye out for what object-oriented programming means and what it consists of.
Complete the guided notes on page 4 of the Activity Packet.
Unit 1 Lesson 3 - Activity
CSA
In Java, a class is a programmer-defined blueprint from which objects are created.
A package is a collection of similar classes.
Unit 1 Lesson 3 - Activity
CSA
Welcome to The Neighborhood
As you watch the video, keep an eye out for which classes are in The Neighborhood package and what you can do with them.
Unit 1 Lesson 3 - Activity
CSA
A UML diagram is a standard way to visualize the design of a program.
A UML diagram is helpful for identifying the components of a class.
Unit 1 Lesson 3 - Activity
Painter | |
xLocation yLocation direction remainingPaint | |
void turnLeft() void move() void paint(String color) void scrapePaint() int getMyPaint() void takePaint() boolean isOnPaint() boolean isOnBucket() boolean hasPaint() | boolean isFacingNorth() boolean isFacingEast() boolean isFacingSouth() boolean isFacingWest() String getColor() int getX() int getY() String getDirection() void setPaint(int paint) |
boolean canMove() boolean canMove(String direction) |
name of the class
CSA
An attribute is a characteristic of an object.
Painter | |
xLocation yLocation direction remainingPaint | |
void turnLeft() void move() void paint(String color) void scrapePaint() int getMyPaint() void takePaint() boolean isOnPaint() boolean isOnBucket() boolean hasPaint() | boolean isFacingNorth() boolean isFacingEast() boolean isFacingSouth() boolean isFacingWest() String getColor() int getX() int getY() String getDirection() void setPaint(int paint) |
boolean canMove() boolean canMove(String direction) |
Unit 1 Lesson 3 - Activity
attributes
behaviors
A behavior is an action that an object can perform.
We'll be learning what these behaviors do in the upcoming lessons!
CSA
Prompt
What attributes does�a Painter have?
Unit 1 Lesson 3 - Activity
What are things a�Painter can do?
Painter | |
xLocation yLocation direction remainingPaint | |
void turnLeft() void move() void paint(String color) void scrapePaint() int getMyPaint() void takePaint() boolean isOnPaint() boolean isOnBucket() boolean hasPaint() | boolean isFacingNorth() boolean isFacingEast() boolean isFacingSouth() boolean isFacingWest() String getColor() int getX() int getY() String getDirection() void setPaint(int paint) |
boolean canMove() boolean canMove(String direction) |
CSA
Creating Objects
As you watch the video, keep an eye out for the syntax for creating a Painter object.
Complete the guided notes on the page 6 of the Activity Packet.
Unit 1 Lesson 3 - Activity
CSA
Lesson 3: The Neighborhood
Unit 1 Lesson 3 - Activity
Investigate: The Painter
CSA
Do This:
1
Unit 1 Lesson 3 - Activity
MyNeighborhood.java
1 | import org.code.neighborhood.Painter; |
2 | |
3 | public class MyNeighborhood { |
4 | public static void main(String[] args) { |
5 | |
6 | Painter myPainter = new Painter(); |
7 | |
8 | |
9 | } |
10 | } |
To instantiate an object is to call the constructor to create the object.
imports The Neighborhood package so its code is available in our program
gives the name myPainter for a Painter object
calls the Painter class constructor to instantiate the Painter object
CSA
The state of an object is the attributes of an object that are represented by its instance variables.
The attributes of a Painter object are xLocation, yLocation, direction, and remainingPaint.
The default state of a Painter object is (0, 0) facing East with 0 units of paint.
Unit 1 Lesson 3 - Activity
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
CSA
Assume this Painter object has 0 units of paint.
What is the state of this Painter object?
Unit 1 Lesson 3 - Activity
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
xLocation = 2
yLocation = 1
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
direction = "south"
CSA
A bug is an error�in the code.
Debugging is the process of finding and fixing problems in an algorithm or program.
Unit 1 Lesson 3 - Activity
MyNeighborhood.java
1 | import org.code.neighborhood.Painter; |
2 | |
3 | public class MyNeighborhood { |
4 | public static void main(String[] args) { |
5 | |
6 | Painter myPainter = new Painter; |
7 | |
8 | |
9 | } |
10 | } |
Console |
/MyNeighborhood.java:6: error: '(' or '[' expected Painter myPainter = new Painter; ^ |
tells us which line caused the error
tells us what Java thinks is missing
shows us the code with a pointer to where the problem occurred
CSA
Create the Painter Object
Lesson 3: The Neighborhood
Unit 1 Lesson 3 - Activity
2
CSA
Do This:
Wrap Up
Unit 1 Lesson 3 - Wrap Up
What is the difference between a class and an object?
Closing
Loop
the
What parts of this lesson were similar to things you have encountered in your life?
What were you confident about? What would you like to practice?
CSA
Today you learned about . . .
Unit 1 Lesson 3 - Wrap Up
CSA
Key Vocabulary
object-oriented programming: an approach to creating and using models of physical or imagined objects
package: a collection of similar classes
object: an instance of a class
class: a programmer-defined blueprint from which objects are created
attribute: a characteristic of an object
state: the attributes of an object that are represented by its instance variables
Unit 1 Lesson 3 - Wrap Up
CSA
Key Vocabulary
behavior: an action that an object can perform
constructor: a block of code that has the same name as the class and tells the computer how to create a new object
instantiate: to call the constructor to create an object
bug: an error in the code
debugging: finding and fixing problems in an algorithm or program
Unit 1 Lesson 3 - Wrap Up
CSA
Debrief
Debrief
@TeachCode
Debrief
Learner Reflection:
As a learner, what literacy skills did you use during this lesson?
Literacy
Definition: being able to make sense of and engage in advanced reading, writing, listening, and speaking
@TeachCode
Debrief
Teacher Reflection
@TeachCode
Debrief
Whole Group Discussion:
@TeachCode
@TeachCode
8 minute break
Return at XX:XX
Access to and Diversity in CSA
@TeachCode
What is CSA?
Meet the CSA Resources!
The What
The How
@TeachCode
Meet the CSA Resources!
@TeachCode
The AP Assessment
Assessment Breakdown + Overview
AP CSA has two assessment parts:
40 Multiple-choice questions | 50% of total AP score | 90 minutes |
4 Free-response questions | 50% of total AP score | 90 minutes |
@TeachCode
AP CSA Endorsed Providers
Code.org is an endorsed provider for AP CSA
What does this mean?
AP CSA is one of the few courses �where the College Board has endorsed �providers for curriculum and professional �development materials.
@TeachCode
AP CSA Endorsed Providers
Code.org is one of several other endorsed providers
Endorsed providers all provide professional development that cover their curriculum and information about the AP course and exam more broadly.
@TeachCode
Getting Familiar with the CED
Getting Familiar with the Course and Exam Description
CSA Course and Exam Description [link]
Table of Contents�Section 1: About AP (pg. 1 - pg. 10)
Section 2: Course Framework (pg. 11 - pg. 160)
Section 3: Instructional Approaches (pg. 161 - pg. 186)
Section 4: Exam Information (pg. 187 - pg. 206)
Section 5: Scoring Guidelines (pg. 207 - pg. 218).
Section 6: Appendix (Java Quick Reference)
You can find a digital copy at AP Central [link] under the “Course Overview”. [direct link to the CED]
@TeachCode
Computational Thinking Skills
Computational Thinking Practices: Skills (pg. 16)
Practice 1: Program Design & Algorithm Development
Practice 2: Code Logic
Practice 3: Code Implementation
Practice 4: Code Testing
Practice 5: Documentation
@TeachCode
Big Ideas
Big Ideas (pg. 17-18)
@TeachCode
CSA Course Structure
Units and Topics
*CED Units vary from the units in Code.org curriculum
@TeachCode
CSA Course Structure
CED pg. 22
@TeachCode
CSA Course Structure
How the framework...works
@TeachCode
Course and Exam Description: Our Interpretation
Code.org takes a layered approach.
This structure allows students to develop understanding of the content while simultaneously developing computational thinking skills. Students learn the fundamentals of object-oriented programming (OOP) first, giving them a foundation for the rest of the course while encouraging them to consider the overall design of their programs.
@TeachCode
Course and Exam Description: Our Interpretation
Lessons connected to Essential Knowledge Statements.
Every lesson plan includes the Essential Knowledge Statements from the CED which are connected to the lesson.
@TeachCode
CSA Course Structure
Code.org Units of Instruction | |
Unit 1: Object-Oriented Programming | Unit 6: Array Lists and String Methods |
Unit 2: Class Structure & Design | Unit 7: Method Decomposition and Recursion |
Unit 3: Arrays & Algorithms | Unit 8: Searching and Sorting |
Unit 4: Conditions and Logic | Unit 9: AP Exam Review & Practice |
Unit 5: Two-Dimensional Arrays | |
CED Units of Instruction | |
Unit 1: Primitive Types | Unit 6: Array |
Unit 2: Using Objects | Unit 7: ArrayList |
Unit 3: Boolean Expressions & If Statements | Unit 8: 2D Array |
Unit 4: Iteration | Unit 9: Inheritance |
Unit 5: Writing Classes | Unit 10: Recursion |
vs
@TeachCode
Course and Exam Description: Our Interpretation
Computational Thinking Practices layered throughout the curriculum.
@TeachCode
Understanding Context - CSA Data
Course and Exam Description: Our Interpretation
Consider the following data from AP CSA exams in the past.
Source: https://code.org/promote/ap
@TeachCode
Code.org Design Choices
Course and Exam Description: Our Interpretation
Code.org’s CSA curriculum implements culturally responsive pedagogy and addressing equity with four main threads:
@TeachCode
Course and Exam Description: Our Interpretation
Task:
Identity and culture
Personally relevant practice
Processing and meaning making
Software Engineering for all
@TeachCode
High-Level Overview:
Methods and Conditionals in Java
@TeachCode
Introduction to Calling Methods
Calling Methods
@TeachCode
UML Diagram
For a closer look, the UML diagram can be found in your Activity Packet on page 5.
Painter | |
xLocation yLocation direction remainingPaint | |
void turnLeft() void move() void paint(String color) void scrapePaint() int getMyPaint() void takePaint() boolean isOnPaint() boolean isOnBucket() boolean hasPaint() | boolean isFacingNorth() boolean isFacingEast() boolean isFacingSouth() boolean isFacingWest() String getColor() int getX() int getY() String getDirection() void setPaint(int paint) |
boolean canMove() boolean canMove(String direction) |
@TeachCode
UML Diagram
Painter | |
xLocation yLocation direction remainingPaint | |
void turnLeft() void move() void paint(String color) void scrapePaint() int getMyPaint() void takePaint() boolean isOnPaint() boolean isOnBucket() boolean hasPaint() | boolean isFacingNorth() boolean isFacingEast() boolean isFacingSouth() boolean isFacingWest() String getColor() int getX() int getY() String getDirection() void setPaint(int paint) |
boolean canMove() boolean canMove(String direction) |
Class Name
Attribute(s)
Method(s)
@TeachCode
UML Diagram
Painter | |
xLocation yLocation direction remainingPaint | |
void turnLeft() void move() void paint(String color) void scrapePaint() int getMyPaint() void takePaint() boolean isOnPaint() boolean isOnBucket() boolean hasPaint() | boolean isFacingNorth() boolean isFacingEast() boolean isFacingSouth() boolean isFacingWest() String getColor() int getX() int getY() String getDirection() void setPaint(int paint) |
boolean canMove() boolean canMove(String direction) |
Each method includes:
@TeachCode
UML Diagram
Painter | |
xLocation yLocation direction remainingPaint | |
void turnLeft() void move() void paint(String color) void scrapePaint() int getMyPaint() void takePaint() boolean isOnPaint() boolean isOnBucket() boolean hasPaint() | boolean isFacingNorth() boolean isFacingEast() boolean isFacingSouth() boolean isFacingWest() String getColor() int getX() int getY() String getDirection() void setPaint(int paint) |
boolean canMove() boolean canMove(String direction) |
We can call each of these methods on a Painter object.
1. Instantiate a Painter object
Painter mindy = new Painter();
2. Call the method you want to use.
mindy.move();
Name of the Painter object
The dot operator
The name of the method
@TeachCode
Practice Using Methods
Do This:
@TeachCode
Introduction to the PLACE
PLACE
Let’s head to the PLACE!�https://place.fi.ncsu.edu/course/view.php?id=456
Participant Code:
g06ns7aw
@TeachCode
Transition to
Asynchronous Session 2
Your Assignment: The PLACE
Managing the Asynchronous Session
Support:
Planning your Time:
Be back at
1:20pm
@TeachCode
Identity and Culture
Have students form groups with their peers, encourage pair share, group work, and sharing work (crossover evaluation). | Allow students to safely be themselves, recognize the brilliance of all students, encourage asking questions, making mistakes, supporting each other. |
Help teachers build strong relationships with students and students build strong working relationships with each other. Show students representations of themselves. Encourage a growth mindset | Encourage persistence, effort and engagement. |
Acknowledging other approaches so that students can build confidence in their coding abilities. | Allow students to “take the lead” by demonstrating to the rest of the class how they solved a problem. |
Creating a classroom environment that celebrates the uniqueness of each student so they are comfortable seek and giving assistance to their peers. | |
@TeachCode
Personally Relevant Practice
A Project Based Learning approach always allows students to work on something of their own selection. | Providing choice in practice and projects makes the content more interesting and valuable to students. |
Differentiated practice, connect CS to personal interests, providing choices | Give students opportunities to discover how computer science intersects with their personal interests. |
Open ended projects will allow students to bring their creativities, which will help reinforce what they’ve learned | Develop programs/progrjects using industry standard tools like VSCode and Git. |
One of my favorite things about the CSP curriculum is the way it allows students to drive their projects in any direction they want, looking forward to similar in CSA. | |
| |
@TeachCode
Processing And Meaning Making
In my class, I almost require everyone to use their own devices. We have affluent population. | Lots of practice, accessing prior knowledge, opportunities for peer help and reflection, “Show Me How” |
Provide multiple representations of information, opportunities for synthesis in many ways | Encourage productive struggle. |
Create mini coding exercises that focuses on specific contents but have multiple entry points | Using individual reflections time and sharing solutions to discover alternate ways of solving problems. |
Reviewing and spiraling through previous concepts to scaffold up to new content. | |
| |
@TeachCode
Software Engineering For All
Last year we had speaker come to classroom NailBot, Cosmos Blockchain Network, and UCSD robotic plane club. | Code allows students to see themselves as programmers and engineers by using diverse people working in many fields in their videos. |
Also, we practice Agile Software Methodology through the year. | Have guest speakers with whom students can identify and be inspired. |
The videos show a variety of careers that require a foundation of computer science | Show how their solutions also solved historical real world problems. |
Constantly reinforce how the four (Problem Solver, Creative, Collaborator, and Learner) are used in each lesson. Making students realize that these are done subconsciously. | |
I have speakers come into my engineering classroom to talk about their work, will likely have CS professionals do the same. | |
| |
@TeachCode
Async Session #2 and Lunch Break in progress
Return time for Afternoon Session: 1:20pm
Asynchronous
Debrief
Model Lesson #2:
U1L7 Writing Methods
@TeachCode
Previously On … Writing Constructors
Previously On … Writing Constructors
Previously On
How can we add behaviors to what is already possible with the Painter class?
@TeachCode
Create a subclass!
@TeachCode
Previously On
Subclass: a class that extends a superclass and inherits its attributes and behaviors
@TeachCode
Inheritance
As you watch the video, keep an eye out for keywords you need to use for superclasses and subclasses.
@TeachCode
Creating the PainterPlus class
@TeachCode
Creating the PainterPlus class
Do This:
Commit Your Code!
Commit Code
Save your new subclass to the Backpack.
Here are some questions you might ask during this portion:
@TeachCode
Creating the PainterPlus class
super keyword: a keyword used to refer to the superclass
constructor signature: the first line of the constructor which includes the public keyword, the constructor name, and the values to specify when an object is created
class header: consists of the class keyword and the name of the class
inheritance: an object-oriented programming principle where a subclass inherits the attributes and behaviors of a superclass
Key Vocabulary
@TeachCode
Creating the PainterPlus class
subclass: a class that extends a superclass and inherits its attributes and behaviors
superclass: a class that can be extended to create subclasses
Key Vocabulary
@TeachCode
Creating the PainterPlus class
How might we use the vocabulary to describe the code we just wrote?
Examples:
PainterPlus is a subclass of the Painter class.
PainterPlus inherits from the Painter class.
Key Vocabulary
Vocabulary
super keyword
constructor signature
class header
inheritance
subclass
superclass
@TeachCode
Creating the PainterPlus class
So far our PainterPlus objects won’t have any new behaviors… we just wrote the constructor.
Remember…
@TeachCode
Hats on!
Teacher - This will be one of the facilitators |
Learner - This group acts in the role of student |
Observer - The facilitator observes the lesson and leads a discussion after the modeled lesson |
@TeachCode
Lesson
Unit 1 - Lesson 7
Writing Methods
Warm Up
Prompt
Do all birds have the same attributes and behaviors as a Bird?
Unit 1 Lesson 7 - Warm Up
Do these birds have additional attributes and behaviors?
Should these additional attributes and behaviors be accessible by the Bird class?
Bird
Penguin
Hawk
HOLD that�THOUGHT
CSA
Activity
Lesson Objectives
Unit 1 Lesson 7 - Activity
CSA
Writing a Method
As you watch the video, keep an eye out for the syntax for writing a method.
Complete the guided notes on page 8 of your Activity Packet
Unit 1 Lesson 7 - Activity
CSA
Prompt
What does it mean for a method to be a void method?
Unit 1 Lesson 7 - Activity
public void move() {
// code to make a Painter object move
}
HOLD that�THOUGHT
CSA
A void method is a method that performs an action�but does not return a value.
Unit 1 Lesson 7 - Activity
public void move() {
// code to make a Painter object move
}
CSA
Prompt
What are the similarities and differences between calling methods and writing methods?
Unit 1 Lesson 7 - Activity
Writing a Method
public void move() {
// code to move
}
Calling a Method
myPainter.move();
HOLD that�THOUGHT
CSA
When we call a method, we specify the object followed by the dot operator then the name of the method we want to use.
Writing a method is giving the instructions that should occur when the method is called.
Unit 1 Lesson 7 - Activity
Writing a Method
public void move() {
// code to move
}
Calling a Method
myPainter.move();
CSA
Unit 1 Lesson 7 - Activity
PainterPlus.java
1 | import org.code.neighborhood.Painter; |
2 | |
3 | public class PainterPlus extends Painter { |
4 | |
5 | public PainterPlus() { |
6 | super(); |
7 | } |
8 | |
9 | public void myNewMethod() { |
10 | // code for new method |
11 | } |
12 | } |
To write a method, we write the keyword public.
Then we specify�the return type.
Then we write the name�of the method.
This line makes up the method signature.
Inside the method body, we write the code for what the method should do when it is called.
CSA
Prompt
What does a PainterPlus object need to do to turn right?
What would we write in the body of the turnRight() method?
Unit 1 Lesson 7 - Activity
HOLD that�THOUGHT
CSA
Do This: Add the turnRight() method to the PainterPlus UML diagram (Page 7 of your Activity Guide)
Unit 1 Lesson 7 - Activity
PainterPlus |
|
turnRight() |
Painter | |
xLocation yLocation direction remainingPaint | |
void turnLeft() void move() void paint(String color) void scrapePaint() int getMyPaint() void takePaint() boolean isOnPaint() boolean isOnBucket() boolean hasPaint() | boolean isFacingNorth() boolean isFacingEast() boolean isFacingSouth() boolean isFacingWest() String getColor() int getX() int getY() String getDirection() void setPaint(int paint) |
boolean canMove() boolean canMove(String direction) |
CSA
Writing and Using a New Method
Lesson 7: Writing Methods
Unit 1 Lesson 7 - Activity
BREAK OUT GROUPS (3 people: 15 Minutes)
CSA
Do This:
1
Prompt
Why would we write a new method in the subclass instead of in the superclass?
Unit 1 Lesson 7 - Activity
xLocation
yLocation
direction
remainingPaint
. . .
Painter
PainterPlus
xLocation
yLocation
direction
remainingPaint
. . .
HOLD that�THOUGHT
CSA
Unit 1 Lesson 7 - Activity
MyNeighborhood.java
1 | import org.code.neighborhood.Painter; |
2 | |
3 | public class MyNeighborhood { |
4 | public static void main(String[] args) { |
5 | |
6 | Painter myPainter = new Painter(); |
7 | myPainter.turnRight(); |
8 | |
9 | } |
10 | } |
Console |
/MyNeighborhood.java:7: error: cannot find symbol myPainter.turnRight(); ^ symbol: method turnRight() location: variable myPainter of type org.code.neighborhood.Painter |
A superclass can't access the methods in a subclass!
CSA
Warm Up
Prompt
What errors did you encounter�while writing your code?
Unit 1 Lesson 7 - Wrap Up
How did you find and fix the error?
HOLD that�THOUGHT
CSA
Debugging Wall
Do This: Choose a strategy to add to the Debugging Wall.
Error Messages
Unexpected Results
Unit 1 Lesson 7 - Activity
strategy
strategy
CSA
Today you learned about . . .
Unit 1 Lesson 7 - Wrap Up
CSA
Key Vocabulary
method signature: consists of a name and parameter list
Unit 1 Lesson 7 - Wrap Up
CSA
Debrief
Debrief
Learner Reflection:
In the CSA curriculum, we have created a number of videos to support content instruction.
@TeachCode
Debrief
Teacher Reflection
@TeachCode
Debrief
Whole Group Discussion:
When watching a video in the classroom, Common Sense Media has the following three tips for making sure students aren’t just passively watching the video but actually comprehending the content [link]:
@TeachCode
Debrief
Whole Group Discussion:
@TeachCode
@TeachCode
8 min Break
High Level Overview:
Syntax in Java
Reflect on Where We Are in the Unit
Reflect on Where We Are in the Unit
Unit 1 Overview
Open up to page 33 of your Curriculum Guide and look at the Unit 1 overview
@TeachCode
Unit 1 Overview
Model Lessons
High-level Overviews
This is the Model Lesson we just did!
Asynchronous Time
@TeachCode
While Loops
While Loops
Do This:
Prompt:
@TeachCode
While Loops
As you watch the video, keep an eye out for the syntax for writing a while loop.
@TeachCode
While Loops
Prompt:
@TeachCode
While Loops
Lesson 9 - Loops, an Overview:
@TeachCode
Two-Way Selection Statements
Two-Way Selection
Do This:
Prompt:
@TeachCode
Two-Way Selection
As you watch the video, keep an eye out for the syntax of an if-else statement and the purpose of the NOT ( ! ) logical operator.
@TeachCode
Two-Way Selection
Pseudocode is a plain language description of the steps in an algorithm.
| |
| |
| |
| |
| |
| |
while the Painter is on a paint bucket
take paint
while the Painter has paint
paint yellow
if the Painter can move forward
move forward
@TeachCode
Two-Way Selection
Do This:
With a partner, write pseudocode for the moveSouth() algorithm.
The moveSouth() method should move the painter south while it is able to to move south. At the end, the painter should be facing south.
Start �state
End �state
@TeachCode
Two-Way Selection - live coding
@TeachCode
Transition to Asynchronous
Session 4
Reflecting on the Day
Wrap up
Journal Prompts:
@TeachCode
Wrap up
Add Gots and Needs!
GOT
NEED
The CED
More Bacon!
@TeachCode
GOTS
How to navigate the resources that are available | How to commit code and use the backpack from lesson to lesson. |
Familiarity with Painter class teaching tool | |
How to use the code.org tools and platform and the resources included | |
Using JavaLab and its console | |
| |
| |
@TeachCode
NEEDS
How to keep classes moving with a variety of skill/ability levels. | |
More pointers/questions for students on how to elicit student comments for discussion goals. | |
How to make sure students are not scared and frustrated early on. | A discussion of all things assessment: the AP Exam, the Unit Exams, FRQs… |
| |
| |
| |
@TeachCode
Parking Lot Wrap
Clear out the Parking lot!
@TeachCode
Your Assignment: The PLACE
Managing the Asynchronous Session
Support:
Planning your Time:
Facilitators available until XX:XXpm
@TeachCode
Take the daily survey!
Please fill out the end of day survey!�
studio.code.org/pd/workshop_survey/day/1�
Background on this survey:
@TeachCode
Async Session #4 in progress
Parking Lot
Enter questions here |
Is code.org making Unit Guides for AP CSP as well? - It has been asked for… but it isn’t in the immediate plans - :( |
|
|
|
|
|
|
|
|
@TeachCode