Parameters, Return, and Libraries - Lesson 4: Parameters and Return Make

Students use the knowledge and skills they've developed working with parameters and return values to develop a Rock Paper Scissors App. Unlike typical Make projects, students are given a significant portion of the starter code but are given three functions with parameters and return values that they'll need to develop themselves. At the end students submit their apps which can be assessed using a provided rubric.

Goals

Students will be able to:

Purpose

Make lessons typically ask students to take on an entirely blank screen when writing their program. In this instance students have to take on the "blank function" which needs to fit within the larger program they're developing. This is part of a broader mindset shift that students develop in this unit. Functions with parameters and return values operate like their own "mini programs" which can be written and tested independently. There is actually less difference than students might think between previous make projects, in which students get the user interface elements and no code, and this project, in which they get some starter code but blank functions with parameters. In each case they need to develop programs that integrate into a larger portion of the project. The focus of this unit is how functions with parameters and return values help further split programs into logical chunks like this.

Resources

Supplemental Code.org material

Getting Started (5 minutes)

Prompt: How do parameters and return change the way you write programs?

Discuss: Have students share their ideas with a partner and then discuss as a class.

Discussion Goal

Goal: This discussion should prompt students to better understand what turns out to be a slightly different make project. Today they're going to be taking on "blank functions" rather than "blank screens". This is because with parameters and return values you can chunk out your programs into pieces that have well-defined behavior. Remind students that this is known as procedural abstraction. If students don't land on these ideas don't aim to force it but return to this idea in the wrap up.

Remarks

Activity (35 minutes)

Build the Rock Paper Scissors App

Teaching Tip

Supporting Students: While students are working on their apps, circulate the room and check in with students who need a little help. Encourage students to collaborate and discuss bugs with each other.

Debugging: Review with students steps they can use to debug if they get stuck:

Group: Make a determination as to whether this project will be completed in pairs or individually. You may even choose to let students decide.

Lesson4_ExampleApp - Explore: Have students explore the working Rock Paper Scissors app. If students are not working in pairs they should still discuss the prompts with a neighbor.

Review: Quickly review what students will be doing again before they move on to the next step.

Distribute: Give students copies of CSP Parameters and Return Make - Rock Paper Scissors App (Activity Guide) if you will be using it during the lesson.

Submit: Encourage students to check the rubric below or on the last page of the Activity Guide before submitting.

Rubric for assessing student projects
CategoryExtensive EvidenceConvincing EvidenceLimited EvidenceNo Evidence
findIcon FunctionThe function returns the correct values for all input values.The function returns the correct values for most input values.The function returns the correct values for some input values.The function does not return correct values for any input values.
randomChoose FunctionThe function returns the correct values for all input values.The function returns the correct values for most input values.The function returns the correct values for some input values.The function does not return correct values for any input values.
decideWinner FunctionThe function returns the correct values for all combinations of inputs.The function returns the correct values for most combinations of inputs.The function returns the correct values for some combination of inputs.The function does not return correct values for any combination of inputs
Code runs without errors.No errors are present in the required code.Some errors are present in the required code.Many errors are present in the required code.The code does not run.
Coding CommentsComments are used to correctly explain the purpose and functionality of all functions.Comments are used to explain the purpose and functionality of most functions.Comments are present, but are not used to explain the purpose or functionality of any functions.Comments are not present.

Wrap Up (5 minutes)

Prompt: How could using parameters and return help you write programs collaboratively?

Discussion Goal

Goal: This prompt should help review ideas that students saw in this project, in particuarly that parameters and return help break programs into chunks. It should also help them see that this approach could be used to collaboratively design programs. If teammates agree in advance what each function should do they can go off and write them separately before coming back together to make the entire app work.

Remarks

Assessment: Grading the Project

Rubric: Use the rubric provided with the project to assess student projects.

Standards Alignment

Next Tutorial

In the next tutorial, we will discuss Code.Org Unit 7 Lesson 5, which describes Learn about libraries.

On this page

The Quorum Programming LanguageCopyright © 2014-2021. Funding for Quorum comes largely from the National Science Foundation (NSF #0940521, #1440878, #1644491, #1640131, #1738259 and #1738252, #2023739, #2048356, #2106392, #2121993). Other contributions can be found on the contributors page.