Learning Resource Type

Classroom Resource

Computer Science Principles Unit 5 Chapter 1 Lesson 5: Building an App: Clicker Game

Subject Area

Digital Literacy and Computer Science

Grade(s)

9, 10, 11, 12

Overview

In this lesson, students add variables to two different exemplary apps to keep track of a score or a count of some number of button clicks. The major topic is variable in scope and understanding the differences, benefits, and drawbacks, of using global versus local variables. This lesson focuses more on using global variables since in event-driven apps that’s what you need to keep track of data across multiple events.

The very basics of a simple if statement are also presented in this lesson, mostly to highlight the difference between the = and == operators. Finally, students are asked to apply what they’ve learned about variables, scope, and if statements, to make their own “clicker” game modeled after one of the exemplars they saw during the lesson.

Students will be able to:
- use global variables to track numeric data in an app.
- give a high-level explanation of what “variable scope” means.
- debug problems related to variable scoping issues.
- modify existing programs to add and update variables to track information.
- create a multi-screen "clicker" game from scratch.

Note: You will need to create a free account on code.org before you can view this resource.

    Digital Literacy and Computer Science (2018) Grade(s): 09-12

    DLCS18.HS.6

    Decompose problems into smaller components through systematic analysis, using constructs such as procedures, modules, and/or objects, with parameters, and which return a result.

    Unpacked Content

    UP:DLCS18.HS.6

    Vocabulary

    • parameters
    • procedures
    • modules
    • objects
    • control structures

    Knowledge

    Students know:
    • removing unessential details can make a process simpler.
    • control structures can assist in programming decisions.
    • how to create a program that returns a result.

    Skills

    Students are able to:
    • decompose a problem.
    • create a program that returns a result.
    • implement control structures.

    Understanding

    Students understand that:
    • removing unessential details can make a process simpler.
    • control structures can assist in programming decisions.
    Digital Literacy and Computer Science (2018) Grade(s): 09-12

    DLCS18.HS.9

    Demonstrate the ability to verify the correctness of a program.

    Unpacked Content

    UP:DLCS18.HS.9

    Vocabulary

    • compile
    • program
    • syntax

    Knowledge

    Students know:
    • proper syntax and formatting for a coding language.
    • how to identify coding errors in a programming language.
    a.
    • programs must be tested to verify that the desired task is executed properly.
    • testing a program requires a scenario where you can easily verify that the result of the program is correct/accurate.
    b.
    • a program can contain one of the following properties, but not be an appropriate program: correctness, efficiency, scalability and readability
    • it is important to have others review your code.
    • that to be a quality program, code must be correct, efficient, scalable and readable.

    Skills

    Students are able to:
    • analyze code for proper syntax and formatting.
    a.
    • create a test case with verifiable results.
    • execute a program with the created test case to verify program performance.
    • locate errors in programming by executing test cases.
    b.
    • work with others to review their code for correctness, efficiency, scalability and readability.

    Understanding

    Students understand that:
    • programming languages each have their own required formatting which must be adhered to for a program to run correctly.
    • errors in programming languages prevent the program from executing its task.
    • each language has its own syntax and method for identifying potential errors.
    a.
    • code can be formatted correctly and a program can still produce unintended results.
    • a test case is vital to verifying that a program is executing a task as intended.
    b.
    • to be a quality program, code must be correct, efficient, scalable and readable.
    • it is important to have others proofread your code.
    Digital Literacy and Computer Science (2018) Grade(s): 09-12

    DLCS18.HS.10

    Resolve or debug errors encountered during testing using iterative design process.

    Unpacked Content

    UP:DLCS18.HS.10

    Vocabulary

    • debug

    Knowledge

    Students know:
    • steps of the problem solving process.
    • how to identify errors in an iterative design process.

    Skills

    Students are able to:
    • review a process and identify errors in procedure.
    • rectify errors found in a process.
    • test resolution to verify that the process now runs as intended.

    Understanding

    Students understand that:
    • errors in a process can prevent a solution.
    • resolving an error will allow the process to function as intended.
    Digital Literacy and Computer Science (2018) Grade(s): 09-12

    DLCS18.HS.38

    Systematically design and develop programs for broad audiences by incorporating feedback from users.

    Unpacked Content

    UP:DLCS18.HS.38

    Knowledge

    Students know:
    • it is vital to seek feedback from others on programs and products.
    • feedback can help make a program or product better.

    Skills

    Students are able to:
    • design and develop a program.
    • publish a program, seeking feedback.
    • make edits to a program based upon user feedback.

    Understanding

    Students understand that:
    • when designing a program, it is important to receive input from your target audience to ensure your product meets their expectations or need.
    Digital Literacy and Computer Science (2018) Grade(s): 09-12

    DLCS18.HS.40

    Use an iterative design process, including learning from mistakes, to gain a better understanding of a problem domain.

    Unpacked Content

    UP:DLCS18.HS.40

    Knowledge

    Students know:
    • that creating an artifact is an iterative process.
    • that feedback serves to make products better.
    • that mistakes are teaching tools that help determine how not to solve a problem.

    Skills

    Students are able to:
    • create and publish.
    • process constructive feedback.
    • persevere through mistakes.

    Understanding

    Students understand that:
    • creating an artifact is an iterative process.
    • feedback serves to make products better.
    • mistakes are teaching tools that help determine how not to solve a problem.
    Link to Resource

    CR Resource Type

    Lesson/Unit Plan

    Resource Provider

    Code.org
    Accessibility
    License

    License Type

    Custom
    ALSDE LOGO