Please enable JavaScript to use CodeHS

Introduction to Computer Science in JavaScript (Golden) (2022)

Description

In this lesson, students will learn more about boolean values. Booleans refer to a value that is either true or false, and are used to test whether a specific condition is true or false.

Objective

Students will be able to…

  • Create boolean variables to represent meaningful yes/no values
  • Print out the value of a boolean variable
Description

In this lesson, students will learn about logical operators. Logical operators allow students to connect or modify Boolean expressions. Three logical operators are the !, ||, && characters.

  • ! = NOT
  • || = OR
  • && = AND
Objective

Students will be able to…

  • Describe the meaning and usage of each logical operator: OR (||), AND (&&), and NOT (!)
  • Construct logical statements using boolean variables and logical operators
Description

In this lesson, students learn how to use comparison operators. Comparison operators let students compare two values.

Objective

Students will be able to…

  • Explain the meaning of each of the comparison operators (<, <=, >, >=, ==, !=)
  • Create programs using the comparison operators to compare values
  • Predict the boolean result of comparing two values
  • Print out the boolean result of comparing values
Description

In this lesson, students learn about if statements as a way to make decisions and execute specific code depending on the validity of a condition.

Objective

Students will be able to…

  • Explain the purpose of if statements
  • Create their own if statements to selective choose which code is executed in their programs
Description

In this lesson, students will learn in greater detail about for loops. For loops in Javascript are written and executed in the same manner as Karel exercises, except now students will explore modifying the initialization statement, test statement, and increment statements of the loops.

Objective

Students will be able to…

  • Create for loops in JavaScript
  • Explain the purpose of for loops
  • Utilize for loops to avoid typing out repeated code
  • Use the loop counter i inside the for loop code to do something different on each iteration
Description

In this lesson, students will explore in more detail how they can modify the initialization statement, test statement, and increment statement in a for loop.

Objective

Students will be able to…

  • Explain the three parts of the for loop (initialization statement, test statement, increment statement)
  • Create for loops that iterate differently than the basic for loop structure (ie count by twos or count backwards)
Description

In this lesson, students will learn how to create for loops to solve increasingly challenging problems by using nested for loops and branching control structures.

Objective

Students will be able to…

  • Explain the purpose of for loops
  • Create for loops to solve increasingly challenging problems
  • Create nested for loops
Description

In this lesson, students will learn how randomization can enhance a program and be used in combination with various control structures.

Objective

Students will be able to…

  • Explain why random numbers are a useful part of computer programs
  • Create random values in a program
  • Utilize the DOCS for the Randomizer class in order to learn how to generate random values
Description

In this lesson, students will explore while loops and JavaScript variables. This combines the ideas of creating variables, updating variables throughout a loop, and determining the correct ending condition.

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
Description

In this lesson, students will learn how to create a Loop and Half. A Loop and a Half is a specific way to write a while loop with the condition being true. Inside the loop, students create a SENTINEL value to break out of the loop whenever that condition is met, causing the loop to end.

Objective

Students will be able to:

  • Explain how the loop-and-a-half structure is different from a traditional while loop
  • Explain what an infinite loop is
  • Explain what the break statement does
  • Create programs that use the loop-and-a-half structure to repeat code until a SENTINEL is met, causing the program to break out of the loop
Description

In this lesson, students review content with a 15 question Unit Quiz.

Objective

Students will be able to:

  • Prove their knowledge of control structures through a multiple choice quiz