Please enable JavaScript to use CodeHS

IB Computer Science Higher Level (Year One)

Description

In this lesson, students are introduced to CodeHS and how Karel the Dog can be given a set of instructions to perform a simple task.

Objective

Students will be able to:

  • Write their first Karel program by typing out all of the Karel commands with proper syntax

  • Explain how giving commands to a computer is like giving commands to a dog

Description

In this lesson, students learn more about Karel and Karel’s world. Students learn about walls in Karel’s world, the directions Karel can face, and how to identify a location in Karel’s world using streets and avenues. In these exercises, students will begin to see the limitations of Karel’s commands. Students will need to apply Karel’s limited set of commands to new situations. For example, how can we make Karel turn right, even though Karel does not know a turnRight command? wocka wocka

Objective

Students will be able to:

  • Identify the direction that Karel is facing
  • Predict what direction Karel will be facing after executing a series of commands
  • Identify a location in Karel’s world using Street, Avenue terminology
Description

This lesson introduces the run method, which is the place where the program starts running. Students will also learn to write full java programs instead of just writing commands. In the the program below, SquareKarel is the name of the class. When we say extend Karel, it means this is a Karel program like the ones we have already written.

public class SquareKarel extends Karel 
{
    public void run()
    {
        putBall();
        move();
        turnLeft();
   } 
Objective

Students will be able to:

  • Explain the purpose of the Run Method
  • Explain the first thing that happens in your program when you click the Run button.
  • Write a fully-formed Java program by including a class and a run method.
Description

In this lesson, students will learn how they can create their own commands for Karel by calling and defining methods. Methods allow programmers to create and reuse new commands that make code more readable and scalable.

Objective

Students will be able to:

  • Define a method, and successfully implement methods in their code.
  • Teach Karel a new command by creating a turnRight() method
Description

In this lesson, students learn in more detail about methods, and how they can use methods to break down their programs into smaller pieces and make them easier to understand.

Objective

Students will be able to:

  • Create methods to teach Karel new commands
  • Explain the difference between defining and calling a method
  • Utilize these methods to write higher level Karel programs that go beyond the basic toolbox of commands that Karel starts with
Description

In this lesson, students learn about Top Down Design and Decomposition. Top Down Design is the process of breaking down a big problem into smaller parts.

Objective

Students will be able to:

  • Break a large problem down into smaller, simpler problems
  • Write methods that solve the simpler problems, and use them as building blocks to solve the larger problem
  • Compare programs and identify good vs poor decomposition
Description

In this lesson, students learn how to style their programs by including comments. Comments allow students to leave notes on their program that makes it easier for other to read. Comments are written in plain English.
Commenting Your Code Example:

/*
 *  multi-line  comments
 */

// single line comments
Objective

Students will be able to:

  • Explain the preconditions and postconditions of a method
  • Create clear and readable comments in their code that help the reader understand the code
  • Explain the purpose of comments
Description

In this lesson, students will learn about abstraction. Abstraction is the act of managing complexity by dissociating information and details in order to focus on relevant concepts.

Objective

Students will be able to:

  • Understand abstraction as the different levels of detail and complexity
  • Understand the importance of abstracting away complexity to solve problems more efficiently
Description

In this lesson, students are introduced to Super Karel! Since commands like turnRight() and turnAround() are so commonly used, students shouldn’t have to define them in every single program. This is where SuperKarel comes in. SuperKarel is just like Karel, except SuperKarel already knows how to turnRight and turnAround, so students don’t have to define those methods anymore. To use SuperKarel instead of Karel, the class that students write extends SuperKarel instead of Karel:

public class MyProgram extends SuperKarel 
{

}
Objective

Students will be able to:

  • Write programs that use SuperKarel instead of Karel
  • Utilize the new toolbox of commands that SuperKarel provides over Karel
  • Read documentation to understand how to use a library (SuperKarel is an example of this)
Description

In this lesson. students learn how to use for loops in their programs. The for loop allows students to repeat a specific part of code a fixed number of times.

For loops are written like this:

for(int i = 0; i < 4; i++)
{
    // Code to be repeated 4 times
}
Objective

Students will be able to:

  • Create for loops to repeat code a fixed number of times
  • Explain when a for loop should be a used
  • Utilize for loops to write programs that would be difficult / impossible without loops
Description

In this lesson, students are introduced a new type of loop: while loops. While loops allow Karel to repeat code while a certain condition is true. While loops allow students to create general solutions to problems that will work on multiple Karel worlds, rather than just one.

Objective

Students will be able to…

  • Explain the purpose of a while loop
  • Create while loops to repeat code while a condition is true
  • Utilize while loops to solve new types of problems
  • Test their solutions on different Karel worlds
Description

In this lesson, students learn about the conditional statement “if”. Code within an “if statement” will only execute IF the condition is true.

if (frontIsClear()) {
    // Code to be executed only if front is clear
}
Objective

Students will be able to:

  • Use conditions to gather information about Karel’s world (is the front clear, is Karel facing north, etc)
  • Create if statements that only execute code if a certain condition is true
Description

In this lesson, students learn about an additional control structure, if/else statements. If/else statements let students do one thing if a condition is true, and something else otherwise.

if/else statements are written like this:

if(frontIsClear())
 {
      // code to execute if front is clear
 }
 else
 {
      // code to execute otherwise
 }
Objective

Students will be able to:

  • Explain the purpose of an If/Else statement
  • Create If/Else statements to solve new types of problems
  • Identify when an If/Else statement is appropriate to be used
Description

In this lesson, students learn how to combine and incorporate the different control structures they’ve learned to create more complex programs.

Objective

Students will be able to:

  • Identify the different control structures they can use to modify the flow of control through a program
  • Combine control structures to solve complicated problems
  • Choose the proper control structure for a given problem
Description

In this lesson, students get extra practice with control structures. Students will continue to see different ways that the if, if/else, while, and for loops affect their code and what Karel can do.

Objective

Students will be able to:

  • Debug common errors in code
  • Use control structures to create general solutions that work on all Karel worlds
Description

In this lesson, students review how they should indent their code to make it easier to read.

Objective

Students will be able to:

  • Explain why it is important to indent code
  • Identify proper indentation
  • Modify a program to have proper indentation
  • Write programs with proper indentation
Description

We define what “code” is, find examples in the real world, and learn about programming as one specific example of code.

Objective

Students will be able to explain what code is in their own words, and provide examples of code in their lives.

Description

We learn about some of the applications of computer programs.

Objective

Students understand why programming is a useful skill, and can explain ways in which programs are being used today. Students will be able to analyze the positive and negative effects of programs and communicate their findings to their classmates.

Description

In this lesson, students will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

Objective

Students will be able to:

  • Define a problem in their own words and plan out a solution to the problem
  • Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
  • Utilize the proper control structures to create general solutions that solve multiple Karel worlds
  • Write clear and readable code using control structures, methods, decomposition, and comments
Description

In this lesson, students complete a summative assessment of the unit’s learning objectives.

Objective

Students will be able to:

  • Prove their knowledge of control structures, functions, decomposition, and comments through a multiple choice quiz