Wiki Page, MsFernandezAP-CSP-2016-2017: Parameters

Wiki Page
2016-07-26T16:10:31-06:00

For week 11, we will continue to learn about parameters by completing Module 4 Parameters (Acting the Same).

Then we will start with Module 5: Parameters (Acting Differently). We will learn more about how to use parameters in computer programs.

Daily Learning Targets for Parameters

By the end of this week, you should have learned about the following.

Complete Module 4: Acting the Same (Parameters). Key concepts you will learn are:

A method can made to act differently each time it is called.

The difference is specified using or more parameters.

Parameters are values that are added to a method call. The values are used specialize the method's behavior - by supplying different values, we get different behavior.

Parameters creates variation within a method; it causes the method to do something different, even thought it has the same list of instructions.

How to specify that a method will expect to have parameter values supplied when it is called.

How to call a method that expects parameter values.

Start Module 5: Acting Differently (Parameters) (Links to an external site.). Key concepts you will learn are:

Up to now, our methods have only taken one parameter at most, but we will see how methods can take any number of parameters.

The values we've passed into methods have so far always been characters in our world. We will see that we can pass in any kind of value - particularly numerical values - and how this can be useful in specifying the variation we are going to explore.

Vocabulary for Modules 4 and 5

Parameter.

Method Call.

"pass values to" a method that "takes" parameters.

Parameter Type.

Default Value.

Assignments, Quizzes, Labs and Problems to be Completed

Please complete the following for Module 4: Acting the Same (Parameters).

Complete the Module 4 Alice World(s) Assignment.

Complete the Module 4 Questions Assignment.

Lecture Presentation on Module 4.

Module 4 Quiz Clicker Questions.

Module 4 Discussion Participation Clicker Questions.

Complete the Module 4 Lab 4.

You will use the Alice World you created for Lab 3 to complete this lab.

Complete the Module 4 Programming Exercise.

Please complete the following for Module 5: Acting Differently (Parameters) (Links to an external site.).

Complete the Module 5: Alice World Assignment.

Complete the Module 5 Questions Assignment.

Lecture Presentation on Module 5.

Module 5 Quiz Clicker Questions.

Module 5 Discussion Participation Clicker Questions.

Complete Lab 5.

You will use the Alice World you created for Lab 3 to complete this lab.

Complete the Module 5 Programming Exercise.

Remember, grammar and punctuation counts! We will be learning a lot of new things this week. Keep track of the assignments and the time you need to complete them!

Creating Two Alice Worlds with Parameters

We will be also be creating two Alice Worlds with Parameters. One of the Alice Worlds we will create from "scratch". You will have to download the other Alice World. The BeetleBand Alice World also has 4 sound files (.wav) that you can download and use with the World.

BeetleBand.a2w

bassGuitar.wav

drum.wav

guitarSolo.wav

saxophone.wav

Text Version: Lesson on Parameters

A computer program, or a list of instructions to have a the computer perform a specific task, can be very long and complex. We learned that we can break up this long list of complex instructions into small, organized pieces called methods.

Methods, therefore, are a set, lists, or collections of instructions with a specific name that describes what that set, list, or collection of instructions tells the computer what to do. For example, the method "blink eyes" or "frog jump", clearly describes the list of instructions or "code" to have the "eyes blink" for an object or have a "frog" object jump.

Methods is a powerful concept that can be used for creating programs by making them easier to create, fix errors or "debug", rearrange code, reuse code, and hide or manage complexity by using "abstraction".

Parameters are another way of using methods that makes our job as computer programmers easier. Parameters are values that are added to a method call. The values change the method's behavior.

For example, we can vary a method that makes an object jump by being able to change how high it jumps! You can change the method by having a parameter causing a method to do something different.

Remember:

Parameters are values that are added to a method call. The values are used specialize the method's behavior - by supplying different values, we get different behavior.

Parameters creates variation within a method; it causes the method to do something different, even thought it has the same list of instructions.

YOU will learn:

How to specify that a method will expect to have parameter values supplied when it is called.

How to call a method that expects parameter values.