CS50 AP Curriculum


Chapter:

Module:


Chapter Overview

(Download as PDF)

Chapter 1: Building Blocks of Programming

(Completion Time: 4 weeks)

 

Topics:

 

Pseudocode

 

An introductions into express computational ideas in a language that can be translated to code. Used correctly, thinking in pseudocode may also help find bugs in your program before you even begin writing a single line of code!

 

Scratch

 

Create your first program using a drag and drop block based language called Scratch, which will allow students to learn concepts without getting mired in syntax.

 

Syntax

 

Moving away from a block-based language and more toward C, students will explore the details of how to express programming concepts in a text based language.

 

Variables

 

Develop an understanding of a variable as a container in which you can store things. Students will then be able to use and update their variables throughout the program.

 

Data types

 

Every time students declare a variable they must bringing it into existence and specify its type. Students will explore the different variable types in C as well as the differences between static and dynamic typing.

 

Operators

 

Showing how we program arithmetic and assignment operations while noting the idiosyncrasies of left gets right where the expression x = 10 means x gets the value of 10. 

 

Boolean Expressions and Conditionals

 

Conditional branching using Boolean expressions are how we as programmers make decisions in our programs. They empower us to take different forks in the road, allowing for different behaviors or different user experiences. 

 

Loops

 

Instead of copying and pasting the same line(s) of code back-to-back, which can get clunky. All modern programming languages contain some variations on the construction of a loop, which permits iteration and repetition.

 

Central Focus:

 

Students begin to apply computational thinking, learning to express ideas first in pseudocode, then a visual language, Scratch, and finally, a text based language, C. They are introduced to various programming elements, and begin writing basic programs with proper syntax.

 

Assignments:

 

Programming Problem: Scratch

To be completed with Scratch

 

Enduring Understandings:

EU 1.1 Creative development can be an essential process for creating computational artifacts.

EU 1.2 Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.

EU 1.3 Computing can extend traditional forms of human expression and experience.

EU 2.2 Multiple levels of abstraction are used to write programs or create other computational artifacts.

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

EU 5.4 Programs are developed, maintained, and used by people for different purposes.

 

Learning Objectives:

LO 1.1.1 - Apply a creative development process when creating computational artifacts.

LO 1.2.1 - Create a computational artifact for creative expression.

LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem.

LO 1.3.1 - Use computing tools and techniques for creative expression.

LO 2.2.2 - Use multiple levels of abstraction to write programs.

LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge.

LO 5.4.1 - Evaluate the correctness of a program.

 

The mission is, quite simply, to have fun with Scratch and implement a project of student?s choice (be it an animation, a game, interactive art, or anything else).

 

Programming Problem: Binary Bulbs

To be completed with Scratch

 

Enduring Understandings:

EU 1.2 Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

EU 5.4 Programs are developed, maintained, and used by people for different purposes.

 

Learning Objectives:

LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem.

LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts.

LO 5.1.2 - Develop a correct program to solve problems.

LO 5.4.1 - Evaluate the correctness of a program.

 

Students will modify an existing Scratch program to add functionality and additional features.

 

Programming Problem: Hello

To be completed with Syntax

 

Enduring Understandings:

EU 1.2 Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.

EU 1.3 Computing can extend traditional forms of human expression and experience.

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

 

Learning Objectives:

LO 1.2.1 - Create a computational artifact for creative expression.

LO 1.3.1 - Use computing tools and techniques for creative expression.

LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge.

 

Students will setup their own instance of the CS50 IDE. Upon completion they will create, compile, and execute their first C program.

 

Programming Problem: Fahrenheit

To be completed with Operators

 

Enduring Understandings:

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

EU 5.5 Programming uses mathematical and logical concepts.

 

Learning Objectives:

LO 5.1.2 - Develop a correct program to solve problems.

LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming.

 

Using C, students will build a program, which can convert from degrees Celsius to degrees Fahrenheit.

 

Programming Problem: Pennies

To be completed with Operators

 

Enduring Understandings:

EU 2.1 A variety of abstractions built on binary sequences can be used to represent all digital data.

EU 2.2 Multiple levels of abstraction are used to write programs or create other computational artifacts.

EU 5.2 People write programs to execute algorithms.

 

Learning Objectives:

LO 2.1.1 - Describe the variety of abstractions used to represent data.

LO 2.2.2 - Use multiple levels of abstraction to write programs.

LO 5.2.1 - Explain how programs implement algorithms.

 

Write a program that calculates exponential growth based on an initial amount of pennies.

 

Programming Problem: Skittles

To be completed with Boolean Expressions and Conditionals

 

Enduring Understandings:

EU 1.1 Creative development can be an essential process for creating computational artifacts.

EU 1.2 Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.

EU 1.3 Computing can extend traditional forms of human expression and experience.

EU 2.1 A variety of abstractions built on binary sequences can be used to represent all digital data.

EU 2.2 Multiple levels of abstraction are used to write programs or create other computational artifacts.

EU 4.1 Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

EU 5.4 Programs are developed, maintained, and used by people for different purposes.

EU 5.5 Programming uses mathematical and logical concepts.

 

Learning Objectives:

LO 1.1.1 - Apply a creative development process when creating computational artifacts.

LO 1.2.1 - Create a computational artifact for creative expression.

LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem.

LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts.

LO 1.3.1 - Use computing tools and techniques for creative expression.

LO 2.1.2 - Explain how binary sequences are used to represent digital data.

LO 2.2.2 - Use multiple levels of abstraction to write programs.

LO 4.1.1 - Develop an algorithm for implementation in a program.

LO 4.1.2 - Express an algorithm in a language.

LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge.

LO 5.1.2 - Develop a correct program to solve problems.

LO 5.4.1 - Evaluate the correctness of a program.

LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming.

 

Students will begin using C functions to implement a pseudorandom guessing game.

Programming Problem: Greedy

To be completed with Boolean Expressions and Conditionals

 

Enduring Understandings:

EU 1.1 Creative development can be an essential process for creating computational artifacts.

EU 2.2 Multiple levels of abstraction are used to write programs or create other computational artifacts.

EU 3.3 There are trade-offs when representing information as digital data.

EU 4.1 Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

EU 5.2 People write programs to execute algorithms.

EU 5.4 Programs are developed, maintained, and used by people for different purposes.

EU 5.5 Programming uses mathematical and logical concepts.
EU 7.4 Computing innovations influence and are influenced by the economic, social, and cultural contexts in which they are designed and used.

 

Learning Objectives:

LO 1.1.1- Apply a creative development process when creating computational artifacts.

LO 2.2.2 - Use multiple levels of abstraction to write programs.

LO 3.3.1 - Analyze how data representation, storage, security, and transmission of data involve computational manipulation of information.

LO 4.1.1 - Develop an algorithm for implementation in a program.

LO 4.1.2 - Express an algorithm in a language.

LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge.

LO 5.1.2 - Develop a correct program to solve problems.

LO 5.2.1 - Explain how programs implement algorithms.

LO 5.4.1 - Evaluate the correctness of a program.

LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming.

LO 7.4.1 - Explain the connections between computing and real-world contexts, including economic, social, and cultural contexts.

 

Students will implement algorithms to create a program that will print the least number of coins needed to give a specific amount of money.

 

Programming Problem: ISBN

To be completed with Loops

 

Enduring Understandings:

EU 1.1 Creative development can be an essential process for creating computational artifacts.

EU 1.2 Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.

EU 1.3 Computing can extend traditional forms of human expression and experience.

EU 2.1 A variety of abstractions built on binary sequences can be used to represent all digital data.

EU 2.2 Multiple levels of abstraction are used to write programs or create other computational artifacts.

EU 4.1 Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

EU 5.4 Programs are developed, maintained, and used by people for different purposes.

EU 5.5 Programming uses mathematical and logical concepts.

 

Learning Objectives:

LO 1.1.1 - Apply a creative development process when creating computational artifacts.

LO 1.2.1 - Create a computational artifact for creative expression.

LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem.

LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts.

LO 1.3.1 - Use computing tools and techniques for creative expression.

LO 2.1.1 - Describe the variety of abstractions used to represent data.

LO 2.2.2 - Use multiple levels of abstraction to write programs.

LO 4.1.1 - Develop an algorithm for implementation in a program.

LO 4.1.2 - Express an algorithm in a language.

LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge.

LO 5.1.2 - Develop a correct program to solve problems.

LO 5.4.1 - Evaluate the correctness of a program.

LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming.

 

The goal is to write a program to validate ISBN numbers by implementing a provided algorithm.

 

Programming Problem:  Mario

To be completed with Loops

 

Enduring Understandings:

EU 1.2 Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.

EU 2.1 A variety of abstractions built on binary sequences can be used to represent all digital data.

EU 2.2 Multiple levels of abstraction are used to write programs or create other computational artifacts.

EU 4.1 Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

EU 5.4 Programs are developed, maintained, and used by people for different purposes.

EU 5.5 Programming uses mathematical and logical concepts.

 

Learning Objectives:

LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem.

LO 2.1.1 - Describe the variety of abstractions used to represent data.

LO 2.2.2 - Use multiple levels of abstraction to write programs.

LO 4.1.1 - Develop an algorithm for implementation in a program.

LO 4.1.2 - Express an algorithm in a language.

LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge.

LO 5.1.2 - Develop a correct program to solve problems.

LO 5.4.1 - Evaluate the correctness of a program.

LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming.

 

Write a program, using loops, to print out the exact number of spaces and hashes to form a half pyramid in the terminal.

 

Programming Problem: Credit (HACKER)

To be completed with Loops

 

Enduring Understandings:

EU 1.1 Creative development can be an essential process for creating computational artifacts.

EU 1.2 Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.

EU 1.3 Computing can extend traditional forms of human expression and experience.

EU 2.1 A variety of abstractions built on binary sequences can be used to represent all digital data.

EU 2.2 Multiple levels of abstraction are used to write programs or create other computational artifacts.

EU 4.1 Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.

EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).

EU 5.4 Programs are developed, maintained, and used by people for different purposes.

EU 5.5 Programming uses mathematical and logical concepts.

 

Learning Objectives:

LO 1.1.1 - Apply a creative development process when creating computational artifacts.

LO 1.2.1 - Create a computational artifact for creative expression.

LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem.

LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts.

LO 1.3.1 - Use computing tools and techniques for creative expression.

LO 2.1.1 - Describe the variety of abstractions used to represent data.

LO 2.2.2 - Use multiple levels of abstraction to write programs.

LO 4.1.1 - Develop an algorithm for implementation in a program.

LO 4.1.2 - Express an algorithm in a language.

LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge.

LO 5.1.2 - Develop a correct program to solve problems.

LO 5.4.1 - Evaluate the correctness of a program.

LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming.

 

Students will write a program, which takes in a credit card number and returns the company it?s from, or that it?s an invalid number.

 

Building Toward Enduring Understandings:

 

EU 1.2 (LOs 1.2.1, 1.2.2, 1.2.3) To build toward EU 1.2, Chapter 1 includes the creation programs in Scratch, a drag and drop language. Students start coding in this chapter and are focused on solving problems in a creative fashion. They also work with modifying Scratch code that we provide them with to create a new project.

EU 1.3 (LO 1.3.1) Students begin to use Scratch and the CS50 IDE to create programs that solve problems in a creative way. They also learn how to solve problems that typically would on pen and paper, more efficiently in a program.

EU 2.1 (LOs 2.1.1, 2.1.2) Students learn about binary and expressing larger numbers using zeroes and ones. They explore limitations of this when it comes to data types and how these levels of abstractions stack to create colors, pixels, images and movies.

EU 2.2 (LO 2.1.1) Students learn about using abstractions to make their code more efficient. In this chapter, they learn how to implement programs using loops, booleans, variables and operators, building upon the fact that the IDE breaks down all of these into series of zeroes and ones.

EU 4.1 (LO 4.1.2) Students start coding in Scratch to develop the skills to solve problems using logic and then transition to C and the syntax that comes along with it.

EU 4.2 (LO 4.2.4) Students use pseudocode to structure the logic behind their programs. Using sentences and phrases to outline. Students solve problems in creative ways and discuss what algorithms are more efficient and the costs of different implementations.

EU 5.1 (LO 5.1.1) Students use Scratch to create a program of their choosing (animations, games and more). They then use these creative skills to solve the assigned problems in Chapter 1 in a new, innovative and creative way.

EU 5.2 (LO 5.2.1) Students learn about pseudocode and after exploring algorithms in the previous chapter. They use this understanding of algorithms as a set of instructions to build on their pseudocoding skills. They are then able to walk through code one step at a time to explain how the computer would interpret each step.

EU 5.5 (LO 5.5.1) Students will create problems using operators, loops, and other mathematical constructs to create programs that solve computational problems.

 

Essential Questions:

 

How are algorithms implemented and executed on computers and computational devices?

Why are some languages better than others when used to implement algorithms?

How can use of variables, loops, and conditionals improve the design of a program?

How do variables, loops, and conditionals allow for more complexity in programs?

How do computer programs implement algorithms?

How do people develop and test computer programs?

Which mathematical and logical concepts are fundamental to computer programming?

How are vastly different kinds of data, physical phenomena, and mathematical concepts represented on a computer?

 

Ways to Launch the Lesson:

 

Pseudocode

 

Have students choose an algorithmic math procedure they know how to do (For example, solving the quadratic equation), and have them express the procedure in words. If there?s time, students can swap procedures and try to guess what the written procedure is supposed to do.

 

Scratch

 

Because this topic is very specific, a teacher could introduce Scratch by having students play some games created in Scratch, either individually or as a class. The game used in lecture is: https://scratch.mit.edu/projects/76196420/

 

Syntax

 

Prepare syntactically incorrect English sentences (missing punctuation, etc). Have students try to decode their meaning. Are there sentences that could mean more than one thing? Explain why computers cannot compile programs with incorrect syntax.

 

Variables

 

Run a demonstration where selected students try to sum up a number via one sheet of paper without talking. Invite around 4 students to the front, and draw a box on the whiteboard. The first student writes a value there. The other students write a number value on a sheet of paper. Have each student add their number to the number on the board, thus updating the ?variable?.

 

Data Types

 

Have students think of a list of how many types of data they think a computer can store. Likely, you?ll end up with responses like ?pictures, videos? which is an opportunity to revisit how bits and bytes store data.

 

Operators

 

Have students think about operations from math. Have them review the order of operations. Use examples of expressions with similar numbers and operations but different parentheses to show the importance of placement both in math and computer science alike.

 

Boolean Expressions and Conditionals

 

Have students articulate how they have their scratch programs make decisions. When have we decided the cat should meow? (Using a Boolean).

 

Loops

 

Have students list the most repetitive tasks they have to do in everyday life (for instance, folding each t-shirt, washing each dish, etc). Discuss when would loops be useful in a real-world context.

 

Demos and Activities:

 

Everyday Algorithms in Real Life

 

Have students use their written assignment 0-2. Students should volunteer to demonstrate another student?s algorithm, to illustrate how quickly things can go off track

Materials:

If a student turns in a particularly compelling algorithm (an interesting task), it may be worth bringing in materials so that the instructions can be carried out.

 

While Loops in Real Life

 

Have a student instruct another student to walk from one location to another location in the room. The challenge: You can only instruct one step at a time. Then, introduce loops and conditions, so that the statement ?walk forward until you reach a wall? is valid.

 

Error Checking

 

As David does in lecture, start with a simple but syntactically correct program. Then, add functionality to it but make syntax errors along the way, soliciting input from the class to fix them.