COMPUTER PROGRAMMER: HOUR OF CODE - INTERMEDIATE
LESSON PLAN OVERVIEW
Career: Computer programmers create, modify, and test the code, forms, and script that allow computer applications to run. They work from specifications drawn up by software developers or other individuals. Programmers may assist software developers by analyzing user needs and designing software solutions. They may also develop and write computer programs to store, locate, and retrieve specific documents, data, and information
Lesson: This lesson plan includes ways to introduce students to the computer programmer career by learning about the basics of coding. Students will play a card game to illustrate how conditionals add complex interactivity to computer programming. Students will then complete online exercises taking them through different coding exercises and challenges step-by-step
Grade Level: Middle Grades
Learning Objectives:
〉 Students will explore the career of a computer programmer and learn how computer applications are created.
〉 Through game playing, students will learn how conditionals add complex interactivity to computer programming.
〉 Students will then complete online coding exercises in Code.org .
〉 Students will gain an insight into the computer programming profession, including common job tasks, salary, career pathways, and credentials required to perform the job.
Materials Needed:
Activity
〉
〉
Activity #2: Intermediate Hour of
〉 Student Worksheet: Intermediate Hour of
〉 Access to computers for pre-assigned Code.org lessons
TABLE OF CONTENTS
TEACHER GUIDE
Lesson Instructions: This lesson plan will help you demonstrate to students some of the skills and procedures used in the computer programming. Begin the lesson by reading the Class Message below to your students, then have them watch the recommended career video. Afterwards, facilitate a discussion using the Class Questions listed below
After the discussion, students will work on two activities. Each activity has a printable worksheet with student instructions and areas to record their work.
You should also familiarize yourself with the student worksheets to provide assistance when needed, demonstrate procedures and to help in facilitating the discussion that ends the activity.
Class Message: Today we are going to explore the career of computer programming. We will discuss some common computer programming tasks, like understanding the role of conditionals in writing computer code. You will also learn some basic computer programming by completing online exercises on the Code.org website.
Computers are all around us. A cell phone is a computer. A modern car has computers in its engine, radio, and inside its dashboard. Computer programs tell computers what we want them to do. When you play a game on a phone, think about how the phone knows the rules of the game. Someone programmed, or “coded,” the game, and the phone was given those instructions when the app was downloaded. Programmers also create the code that make web pages and computers in cars, TVs, and appliances in your home work.
The more you learn about coding, the easier it will be for you to understand how coding makes all of these devices work. By understanding coding, you could even create your own game or website.
Let’s watch this brief video to better understand the career of computer programming and how programmers affect our everyday lives.
Class Questions:
〉 What are some of the things in this classroom that a computer programmer may have programmed? - Possible responses: computer workstations, overhead projector, audio visual equipment, electronic bulletin board, etc.
〉 What things in your home may have been programmed by a computer programmer? - Possible responses: all smart devices – TV, disk player, laptop, gaming systems, home security system, etc
〉 What other examples of technology in our everyday life were probably programmed by a computer programmer? - Possible responses: smart cars, drones, smart watches, Bluetooth headphones, etc
Student Activities: This lesson plan includes two student activities. In Activity #1 students will learn how conditionals add complex interactivity to computer programming. In Activity #2, students will complete coding exercises in Code.org.
Read and familiarize yourself with the student worksheet for each activity.
Activity #1: Conditionals with Cards
In the Conditionals with Cards game, students will play two simple card games using a standard deck of cards to learn how coding rules lead to different outcomes depending on the user actions or choices. This activity shows how the rules of a game are like the conditional “if-then” statements in computer programming. First, the students will play a card game with a simple set of rules. After that, the game’s rules will be changed so the students have more choices to make when playing and more factors to consider. This will illustrate how conditionals add complex interactivity to computer software.
Activity Instructions:
〉 Hand out the activity worksheet.
〉 Walk students through the Rules of the Game.
Rules of the Game:
〉 Divide students into two even teams: Team A and Team B. If one of the teams has an extra person, someone from the smaller team takes two turns in the game.
〉 Shuffle the deck of cards and give each person one card (if someone will be taking two turns, they still only get a single card).
〉 Place the deck of remaining cards on the table. Each person may look at their card.
〉 For each turn, a person on each team will draw one card from the deck, then choose to play one of the two cards they’re holding at the same time the other person plays their card.
〉 Once the two cards have been played, award points to each team based on the game rules below:
If (THE CARD FOR TEAM A is RED)
Award TEAM A 1 point.
If (THE CARD FOR TEAM B is RED)
Award TEAM B 1 point.
〉 Repeat this process until all players have had a turn. The team with the most total points wins.
If (THE CARD NUMBER FOR TEAM A is lower than THE CARD NUMBER FOR TEAM B*)
Award TEAM B the number of points on THE CARD FOR TEAM A.
Else If (THE CARD NUMBER FOR TEAM B is lower than THE CARD NUMBER FOR TEAM A)
Award TEAM A the number of points on THE CARD FOR TEAM B.
Else If (THE CARD NUMBER FOR TEAM A is equal to THE CARD NUMBER FOR TEAM B)
If (BOTH CARDS are RED)
Award BOTH TEAMS 0 points.
Else If (BOTH CARDS are BLACK)
Award BOTH TEAMS 0 points.
Else
Award THE TEAM WITH THE RED CARD 1 point.
*Count all face cards as 10 points and count aces as 1 point
〉 Repeat this process until all players have had a turn. The team with the most total points wins.
Activity Results: Hopefully, students had fun playing these card games. Point out that the rules of the card games used conditionals (if-then statements). Conditionals are useful in programming because they enable computers to do different things based on other pieces of
information, like comparing two cards played in the card game. Think about the two card games students just played and be prepared to discuss the following questions.
Activity Discussion:
〉 In the first game, a point was awarded to a team when one of their players played a red card. How could the wording in the rules be changed to award a point for playing a black card, instead of a red card? If (THE CARD FOR TEAM A IS BLACK) Award TEAM A 1 point, If (THE CARD FOR TEAM B is BLACK) Award TEAM B 1 point.
〉 In the first game, points were scored based only on the color of the cards played. How were the rules changed in the second game to compare the cards played by both teams? - Possible responses: the team with the highest card is awarded the amount of points on the other team’s card. Also, if card numbers were the same, only the team with a red card would get the points.
〉 Sometimes conditional statements are placed within other conditional statements. Which section of the card game rules used conditionals inside of other conditionals?Possible responses: Conditional statements were used in Game #2
〉 It can take a lot of work to lay out rules for all the different situations that might happen in a game. What could happen if a game’s rules didn’t have a section on what to do in a certain situation, like if the cards played have equal numbers?Possible responses: if the game didn’t have rules addressing all possible outcomes, the game would end in a tie. For example, in Game 2 if both teams had the same number and both had a Black card, there are no rules to define what happens.
〉 The rules of the second game were more complex than the first. How did more complex rules change the way you played the second game, compared to the first?Possible responses: instead of always playing just a red card, you should play the highest number red card to earn the most points
Activity #2: Intermediate Hour of Code
This activity includes exercises and challenges at an intermediate level of coding for different situations. Students can begin by visiting the links listed for each exercise on their Activity Worksheet. All Code.org lessons are designed to run within most common web browsers, on most operating systems, and on a variety of devices.
Teachers may also wish to use other online Hour of Code activities. Code.org has a list of other online lessons related to coding here: (http://tn-caps.com/r/68CL1)
Activity Instructions:
〉 Hand out the activity sheet.
〉 Facilitate an introduction to the activity.
〉 Walk students through the instructions for the activity.
〉 After completion, facilitate a discussion of the activity using the questions below.
Activity Results: Students complete their assigned lessons in Code.org to learn some of the basics of computer programming.
Activity Discussion:
〉 What do you think about using the Blockly method of dragging and dropping to program code? Did you find it difficult to understand? - Allow students to share their experience.
〉 What was the most challenging part of using the Play Lab? - Allow students to share their experience
〉 What did you like the most about computer programming in the lessons you took? What did you like the least? - Allow students to share their experience.
CAREER INSIGHT
Career Highlight: This lesson plan highlights some of the skills a computer programmer uses on a daily basis to develop and code new software and computer processes. See the Employers in My Area section to contact businesses and organizations in your area about classroom demonstrations, on-site visits, or other additional career exposure opportunities
Featured Career: Computer Programmer
Career Descriptions: Create, modify, and test the code, forms, and script that allow computer applications to run. Work from specifications drawn up by software developers or other individuals. May assist software developers by analyzing user needs and designing software solutions. May develop and write computer programs to store, locate, and retrieve specific documents, data, and information.
Other Names for this Career: Software Developer, Web programmer, Analyst Programmer, Programmer, Application Programmer Analyst, Programmer Analyst, Web Applications Programmer, Java Developer, Internet Programmer, Computer Programmer Analyst
STANDARDS ALIGNMENT
Activities #1 & #2:
Computer Science Standards
〉 Interact with peers, experts, and others using a variety of digital tools and devices. CCP.17 Explain the processes used to collect, transform, and analyze data to solve a problem using computational tools.
〉 Contribute, individually or as part of a team, to work to identify and solve authentic problems or produce original works using a variety of digital tools and devices.
〉 Exhibit a positive mindset toward using technology that supports collaboration, learning, and productivity.
〉 Use multiple processes and diverse perspectives to explore alternative solutions.
〉 Compare different algorithms that may be used to solve the same problem in terms of their speed, clarity, and size.
〉 Identify that various algorithms can achieve the same result and determine the most efficient sequence.
〉 Recognize there are tradeoffs in computing
〉 Explain the processes used to collect, transform, and analyze data to solve a problem using computational tools.
〉 Compare different algorithms that may be used to solve the same problem in terms of their speed, clarity, and size.
Science and Engineering Practices
Planning and carrying out controlled investigations to collect data that is used to test existing theories and explanations, revise and develop new theories and explanations, or assess the effectiveness, efficiency, and durability of designs under various conditions.
School Counseling Model and Standards
〉 Develop and practice effective technology skills
〉 Exhibit creativity
〉 Demonstrate critical thinking and decision-making skills to make informed decisions
〉 Engage and persevere in challenging coursework
〉 Work effectively in diverse groups by developing and employing leadership and teamwork skills
EDUCATOR RUBRIC
ITEM
Teamwork Activity #1
Does Not Meet Expectations
Student did not work well in their team.
Independent Work Activity #2
Student struggled to work independently on the Hour of Code lessons. Student distracted others.
Meets Expectations Exceeds Expectations
Student worked well in their team and contributed equally.
Student worked well independently.
Student worked well in their team, contributed equally and exhibited leadership.
Student worked well independently and also showed leadership assisting others.
Play Lab Level 10
Flappy Code Level 20
Student was not able to complete 5 of the 10 levels of coding
Student completed 7 of the 10 levels of coding
Student completed all 10 levels of coding.
Student was not able to complete 5 of the 10 levels of coding
Student completed 7 of the 10 levels of coding
Student completed all 10 levels of coding.
ACTIVITY #1: CONDITIONALS WITH CARDS
Introduction: Let’s play two games that show how computers use instructions for different situations. The key to these instructions is a type of programming statement called “conditionals.” Conditionals tell computers what to do when a choice needs to be made and base the choice on some piece of information, like a user’s actions.
Activity Description: The two card games you’re about to play use conditionals in the rules to determine how points are awarded. The first game is pretty simple, but in the second game the rules are changed by adding more conditional statements. Think about how these extra conditional statements change the rules so the players have more options to score points in the game
Activity Procedure:
〉 Your teacher will shuffle the cards and give each student one card. (if someone will be taking two turns, they still only get a single card.)
〉 Each member of each team will draw and play a card in the same turn.
〉 In turn, each player draws a card and plays one of their two cards at the same time the person from the other team plays one of their cards.
〉 Compare the cards and award points to each team based on the game rules.
〉 Repeat this process until all players have had a turn.
〉 The team with the most total points wins.
If (THE CARD FOR TEAM A is RED) Award TEAM A 1 point.
If (THE CARD FOR TEAM B is RED) Award TEAM B 1 point.
〉 Repeat this process until all players have had a turn. The team with the most total points wins.
If (THE CARD NUMBER FOR TEAM A is lower than THE CARD NUMBER FOR TEAM B*)
Award TEAM B the number of points on THE CARD FOR TEAM A.
Else If (THE CARD NUMBER FOR TEAM B is lower than THE CARD NUMBER FOR TEAM A)
Award TEAM A the number of points on THE CARD FOR TEAM B.
Else If (THE CARD NUMBER FOR TEAM A is equal to THE CARD NUMBER FOR TEAM B)
If (BOTH CARDS are RED)
Award BOTH TEAMS 0 points.
Else If (BOTH CARDS are BLACK)
Award BOTH TEAMS 0 points.
Else
Award THE TEAM WITH THE RED CARD 1 point.
*Count all face cards as the number 10 and count Aces as the number 1.
Activity Results: This activity shows how the rules of a game are like the conditional “ifthen” instructions used in computer programming. First, you played a card game with a simple set of rules. After that, the game’s rules changed so you had more choices to make when playing and more factors to consider. This activity illustrated how conditionals add complex interactivity to computer programming.
Activity Discussion:
〉 In the first game, a point was awarded to a team when one of their players played a red card. How could the wording in the rules be changed to award a point for playing a black card, instead of a red card?
〉 In the first game, points were scored based only on the color of the cards played. How were the rules changed in the second game to compare the cards played by both teams?
〉 Sometimes conditional statements are placed within other conditional statements. Which section of the card game rules used conditionals inside of other conditionals?
〉 It can take a lot of work to lay out rules for all the different situations that might happen in a game. What could happen if a game’s rules didn’t have a section on what to do in a certain situation, like if the cards played have equal numbers?
〉 The rules of the second game were more complex than the first. How did more complex rules change the way you played the second game, compared to the first?
ACTIVITY #2: INTERMEDIATE HOUR OF CODE
Introduction: These activities show you how coding is used in different situations and will take you through different coding exercises and challenges step-by-step.
Activity Description: Today, you get the opportunity to take online lessons that will walk you through some coding exercises and challenges.
Activity Procedure: To begin the lessons, Ctrl+Click the image or click the link below the image. Work at your own pace through the exercises and challenges.
Intro to Play Lab (Intermediate Level)
Explore the basic commands used in programming a computer game.
http://tn-caps.com/r/68CL2
Activity Discussion:
Hour of Code: Flappy Code (Intermediate Level)
Use drag-and-drop programming to make your own Flappy Bird game.
http://tn-caps.com/r/68CL3
〉 What do you think about using the Blockly method of dragging and dropping to program code? Did you find it difficult to understand?
〉 What was the most challenging part of using the Play Lab?
〉 What did you like the most about computer programming in the lessons you took? What did you like the least?