Please enable JavaScript to use CodeHS

FTCE CS Exam Prep

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

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?

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 program, 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

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

Methods are used to teach Karel a word or command. Using methods allows students to break down their programs into smaller pieces and make it 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 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 we take a look at more conditional statements, more specifically if/else statements. If/else statements let us do one thing if a condition is true, and something else otherwise.

We write if/else statements 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 we take a look at control structures. Some control structures allow us to ask questions: if, if / else statements. Other control structures allow us to repeat code like for loops and while loops. Basically, control structures allow us to control the way the commands execute.

Objective

Students will be able to…
* Identify the different control structures we 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, we review more lesson in Karel and 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…
* Analyze a solution to a problem and explain why it works
* Use control structures to create general solutions that work on all Karel worlds

Description

In this lesson, we review how student should indent their code to make it easier to read. Indenting helps to show the structure of the code.

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

This lesson is a summative assessment of the unit’s learning objectives.

Objective

Assess student achievement of the learning goals of the unit