Alice Variables Pepper.

Slides:



Advertisements
Similar presentations
Getting Started With Alice: The Basics By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
Advertisements

Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
How Tall Are You? Introducing Functions By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made June 2014 by.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Alice Variables Pepper. Set to Java look Edit / preferences restart.
Creating Functions Pepper. Homework Asking the user: –Drag variable to create a set statement –Drag a world function NumberDialog or StringDialog over.
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running o Stored in.
Week 4-5 Java Programming. Loops What is a loop? Loop is code that repeats itself a certain number of times There are two types of loops: For loop Used.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Making a Timer in Alice.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Getting started with Alice Adapted from presentations by Jenna Hayes, Duke University Donna Gavin, UWP Computer Science and Software Engineering.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
Creating a Canvas Account! Follow these simple directions to access the course materials for this year.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2: Methods and Data Programming with Alice and Java First Edition.
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops Susan Rodger Duke University July 2011.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running Types of data.
The Essentials of Alice (Bunny) By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
Illuminating Computer Science CCIT 4-6Sep
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
If you don’t have Google Earth downloaded already, you can go to to get it.
Getting Started With Alice: The Basics. Step 1: Background Open up Alice, and choose a background for your Alice world. Your world is something you can.
DAY 4. MAKING SOMETHING ‘JUMP’ Simple! Move it a certain amount ‘up’ Glide back to your original spot.
The Essentials of Alice (Bunny)
Class-Level Variables in Alice
Getting Started With Alice: The Basics
A Simple Quiz for Alice 3.2:
An Introduction to Alice (Short Version)
Comparing objects and changing color
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops
Changing Color, Using Text Objects, and Random Selection in Alice
Introduction to Events
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
The Essentials of Alice
What is Google Classroom?
Introduction to Object-Oriented Programming
Programming using Alice 3
Memory Matching Challenge
Learn… Create… Program
UNITY TEAM PROJECT TOPICS: [1]. Unity Collaborate
A Simple Quiz for Alice 3.2:
Creating Functions Pepper.
Learn… Create… Program
Methods Tutorial: Part Two
Objects in Alice: Positioning and Moving Them
Introduction to TouchDevelop
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
An Introduction to Alice
Using Functions in Alice
Princess & Dragon Part 3: A Knight Comes Riding In—Cameras & Events
Introduction to Object-Oriented Programming in Alice
How Tall Are You? Introducing Functions
Getting Started With Alice
Professor Susan Rodger
Getting Started With Alice: The Basics
Alice and Daisies: Positioning and Moving Objects in Alice
Using Placeholders to Simplify your Methods: Learning Methods, Part 2
Lesson One: Objects in Alice: Positioning and Moving Them
Learn… Create… Program
Learn… Create… Program
Professor Susan Rodger
Basic Mr. Husch.
under the direction of Professor Susan Rodger
Presentation transcript:

Alice Variables Pepper

Set to Java look Edit / preferences restart

Homework process Email pepper@adelphi.edu if it was not Okay for you Need to be learning in addition to handing in work

What you should be learning Project process – design, code, test Line by line flow of a program, dipping into and back from methods and functions Methods Types – world, object Calling method vs Defining method Why to use (break, teach, reuse)

More to know Use functions Answers a question Returns value Match to the type of value (The method did not return a value.)

Know about variables boxes hold certain type of data Can be set and changed When used, will have the value at a moment in time. Little quiz

Local Variable What: A box that holds a value the method can see and change on each run How to create: Click create new variable on right How to set: drag down to become a green line How to use: drag on top of a value of the same type Why:

Local Variable - Why Can change once and control more than one result - helped some people play with results to make a smooth movie Can get input from user or random value to put into value Can do calculations on that value If you know there will never be a change, less value to a variable Making something a number instead of a variable is called hard coding

Parameters What: Give control outside method How to create: Click the create new parameter button How to set initially: give a value in the calling method How to reset: drag down to become a green line How to use: drag on top of a value of the same type WHY?

Why Parameters Help you reuse methods Ex: Let the situation control how high to jump The one making the method does not need to know value, but must code for all possible values

Coming objectives Asking user for input Create functions Property variables Extra - read in book movement vehicle

Practice Review: My rule for my dancer: This dancer always spins right twice as much as left. One scene with one dancer Dancer spin right 2 times Dancer spin left 1 time Dancer move forward 1 meter

Practice review Note the use of parameters. Does your spin method have parameters? I changed my mind, make it 14 times right and 7 times back - how did a variable help that?

Practice review change 2 Add the dancer asks how many times to spin and then spins the number you tell her forward that many and back ½ as many Could you do this without a variable? Show how to set a variable as the answer to a question. (First set, then drag world question function - note using a function)

Practice Review 2 solution Which is the calling method here? Which is the called method? What is being returned from the method? What is being returned from the say function?

Practice Review 3 Now, I don't want to ask the user. Instead, I want the main method to tell the dancer to spin 6/3 the first time and 2/1 the last time. What do I use to help me do this now?

Practice Review 3 solution How did parameters and variables help you in your homework? Did it make it easier to keep trying different movements until you found one that looked good? Now pass the dancer something to say. Can't do that with a number.

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

Make your own function to have the ballerina ask the user their first name and last name and return the full name. remember a+b world function Story is now: Dancer asks your first and last name Dancer spin right 2 times Dancer spin left 1 time Dancer says hello to you Dancer move forward 1 meter Dancer says goodbye to you

New function solution

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?

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 "It 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