Variables, Conditionals, and Functions - Lesson 12: Project- Decision Maker App Part 1

Overview

Using a Project Planning Guide, students work through the stages of creating an app from scratch. This is the first day of a three-day project. This lesson is devoted to the planning phase.

Goals

Students will be able to:

  • See rubric for guidance in measuring student learning

Purpose

The Practice PT gives students the opportunity to design and program an app from scratch. Welcome to The Decision Maker App! Students demonstrate mastery of variables, conditionals, and functions by combining these elements into a useful program designed to solve the problem of making a decision.

Resources

Supplemental Code.org material

For the students

Getting Started (5 minutes)

Teaching Tip

Short Intro: The Warm Up today is short and light. Students should spend the maximum amount of time working on their projects.

Remarks

  • Have you ever been stuck trying to make a decision? What movie should we watch? Where should we go for lunch? How many chocolate bars can I buy? For the next three days you will build an app to help people make a decision.

Activity (40 minutes)

Explore Projects: Direct students to explore two apps from the CSP-Wideget Repository, Lesson12_ExampleApp1 and Lesson12_ExampleApp2. These apps should spark ideas in what the students can create for this project.

Discussion Goal

Sample App #1: Where Should I Eat?

  • Recommends a restaurant to the user.
  • Inputs: text box for user name, drop down menu for restaurant type, up and down buttons to control the amount of dollars the user wants to spend.
  • Outputs: Text box at the bottom of the screen which displays the recommendation and sound that plays when the user interacts with the app.
  • Variables: username, type of restaurant, dollar amount, output text
  • Conditional Logic: If the dollar amount within certain amounts, recommend different restaurants
  • Function: Update the screen every time the user changes an input.

Sample App #2: Activity Finder

  • Recommends an activity to the user.
  • Inputs: text box for user name, drop down menu for time of day, drop down menu for activity level.
  • Outputs: Text box at the bottom of the screen which displays the recommendation and sound that plays when the user interacts with the app.
  • Variables: username, time of day, activity level, output text
  • Conditional Logic: If the user selects certain times of day and activity levels, make targeted recommendations.
  • Function: Update the screen every time the user changes an input.

Discuss: For each app, discuss the following:

  • What does this app do?
  • What are the inputs?
  • What are the outputs?
  • What variables do you think would be necessary for this app to work?
  • What kinds of conditional logic do you think are necessary to make it work?
  • How could a function be used in this app?

Distribute: Each student should have a copy of the Practice PT Decision Maker App Planning Guide.

Remarks

  • For this project you will create an app that helps a user make a decision. Your app must take in at least one number and one string from the user that will help to make the decision. All of this information will be used as part of the decision making process. In addition, your code must include at least one function used to update the screen.

Discuss: Review the rubric requirements in the following chart or in the supplemental Planning Guide.

Rubric for Practice PT Guide
Category: App Development Planning GuideConvincing Evidence:Planning guide is fully completed Approaching Evidence: Planning guide is mostly completedLimited Evidence: Planning guide is somewhat completeNo Evidence: Planning guide is not complete
Written Response 1:Response accurately describes the purpose, functionality, and inputs/outputs of the app.Response describes the purpose and functionality, or the inputs/outputs of the app.Response partially describes the purpose and functionality, or the inputs/outputs of the app.Response does not describe the purpose, functionality, and inputs/outputs of the app.
Written Response 2:Response clearly describes an idea or recommendation provided by a partner / peer and how it improved the app.Response describes an idea or recommendation provided by a partner / peer and how it improved the app, but there is some confusion.Response describes an idea or recommendation provided by a partner, but does not explain how it improved the app.Response does not describe an idea or recommendation provided by a partner.
User Interface:The User Interface is easy to navigate and it's clear how the app is designed to be used. All text is readable.The User Interface is mostly easy to navigate and it's clear how the app is designed to be used. All text is readable.The User Interface is lacking in some readability or it's not clear how to use the app.The User Interface is difficult to navigate and it's not clear how the app is designed to be used. Text is unreadable.
Code: Warnings & Error MessagesNo warnings or error messages appear when the app is run.A few warnings or error messages appear when the app is run.Many warnings or error messages appear when the app is run.The app does not run at all.
Code: VariablesAt least one number and one String are each stored in a variable and used to make a decision.One data type (numbers or Strings) is stored in at least two variables and used to make a decision.One variable stores either a number or String and is used to make a decision.No variables are set up or used to make a decision.
Code: FunctionA function is used to update the screen. The function is called at least two times in the program.A function is used to update the screen. The function is called one time in the program.A function is created to update the screen but is not called in the program.A function was not created to update the screen.
Code: ConditionalA conditional is used inside of the function to make a decision based on information stored in variables. The conditional correctly uses a logical operator (&&, ||, or !) in the Boolean expression. The decision is displayed on the screen. There are at least three different responses that could be displayed.A conditional is used inside of the function to make a decision based on information stored in variables. The conditional does not correctly use a logical operator (&&, ||, or !) in the Boolean expression. The decision is displayed on the screen. There are at least two different responses that could be displayed.A conditional is created inside of the function, but does not use information stored in variables to make a decision or display it on the screen.No conditionals are present in the function.
Code: CommentsThe update screen function has a comment which clearly explains its purpose and functionality.The update screen function has a comment which clearly explains its purpose or functionality.A comment is present, but it does not clearly explain anything about the function.No comments are present.
Teaching Tip

Supporting students in Practice PT Lessons

The teacher plays the role of a guide throughout the Practice PT lessons. In preparation, you may want to set aside some time to complete the project yourself to identify potential points of confusion for your classroom.

In this first lesson, the classroom progresses together through steps 1-3, and then students work at the own pace for steps 4-6. Circulate the room and check in with students as needed to make sure instructions are clear and students understand expectations.

What should you expect?

  • Students writing and sketching in the Planning Guide
  • Active discussion around project ideas
  • Students should only be in Quorum Studio if they have finished Steps 1-6 early and are ready to begin designing the interface for their app. If this is true, they can move on to the first level in Lesson 13.

Display: Show the steps students will complete today in the Planning Guide:

  1. Brainstorm App Ideas: Students come up with three distinct ideas.
  2. Choose One Idea: Students should select one of their three ideas to turn into an app.
  3. Survey Your Classmates: Students discuss with two classmates the decision their app will help the user make and decide what information is needed to make this decision.
  4. Storing Information: Variables needed for storing information are listed in this section.
  5. Flowchart: Students create a flowchart, following the "Can I adopt a cat?" sample flowchart from the Conditionals Explore lesson.
  6. Design User Interface: There is space for students to design up to three screens. There are no screen requirements for the app, so students may use only one screen.

Wrap Up (0 minutes)

No wrap up today. All time should be spent on the project.

Standards Alignment

  • CSTA K-12 Computer Science Standards (2017): 2-AP-10, 2-AP-11, 3A-AP-16, 3B-AP-14

Next Tutorial

In the next tutorial, we will discuss CSP Unit 4 Lesson 13 Project - Decision Maker App Part 2, which describes Unit Project Day 2.