Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating Functions Pepper.

Similar presentations


Presentation on theme: "Creating Functions Pepper."— Presentation transcript:

1 Creating Functions Pepper

2 Homework Asking the user: Speaking a number
Drag variable to create a set statement Drag a world function NumberDialog or StringDialog over the value Speaking a number Drag a character’s say method to create a say statement Drag the world’s to string function Drag the variable into the world’s to string function Download from moodle and fix one character each

3 Functions we have used World User question for number World to String
Bunny Distance to 3

4 Make your own function 2 to have your character ask the user their first name and last name and return the full name. (use a+b world function to put together full name) Create the function: Click on character Click on function Click create new function returning a string In the function: Click new variable for first name Click new variable for last name Ask user for first name Ask user for last name Return first + last (dragging over to what) 4

5 New function solution 5

6 New function questions
Which command used the function? Why did you need a variable in this case to put the function into? Can you use this function without putting it into a variable? 6

7 Homework Have finished reading chapter 1, 2 & 3
Each person should add 2 methods to any one character. 1) a whoAmI function that will ask the user for his first name and last name and return the full name. 2) a sayHello method that accepts a name parameter and will say "My name is " and the name parameter and "I have a movie for you." When the methods have been added, please upload your character to the discussion board. Then, one person can create a movie with these characters. Create a variable for each character's name. Then it should ask the user to name the characters (meaning set variable to the whoAmI function). Then, it should call the sayHello method on each character, passing in their name. Only one person needs to upload. Please name the world file with both people's names. ex: kris_pepper_and_mary_smith.a2w 7


Download ppt "Creating Functions Pepper."

Similar presentations


Ads by Google