DOC PREVIEW
TRINITY CSCI 1311 - Variables and Parameters
Pages 9

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Variables and Parameters1/28/20082Opening Discussion■Do you have any questions about the quiz?■Let's look at solutions to the interclass problem.■Minute Essay responsesHow can you make the camera view the scene from above?Timing between provided walk methods and moves. For this you have to play with the speed and distance of the move.3A Problem■Consider the following problem. I'd like to have the penguin walk up to the skeleton, say “hi”, then walk back to where he started?■How can we accomplish this? What challenge do we face given what we know?4Variables■You should be familiar with the concept of a variable from algebra. Programming variables are similar, but not quite the same.■A variable is a name that we create that is attached to a chunk of memory in the computer that stores a value.■Unlike a math variable, the value of a programming variable can change as we execute the program.5Method Variables■Also called local variables, we create these in the method in which we want to use them.■We use these to compute and store values.■We have to provide a name and a type. Alice has four variable types.NumberBooleanObjectOther■Let's do this for a calculated value.6User Input■One of the uses of variables is to store values input by the user.■The world has methods that will bring up dialog boxes that we can use to enter values into a program.■The world also has helpful math functions that you might need to use to calculate certain values.■Some of these functions work with “Strings”. String is just the name that computer scientists have given to normal text data.7Another Problem■Assume that I made it so that the mummy did the same thing to the penguin and the skeleton. Now assume I add three more characters and want the same thing to happen to them.■What challenge would we face in trying to make this happen? What do we need to be able to do to get around this?8Parameters■Parameters are basically variables that we pass into methods. These give us the power to not have to duplicate too much code.■You have used parameters in many of the methods that are built into Alice. They simply provide information to the method to help it do what we want.■Let's use parameters to help simplify the code in our mummy world so that we don't have unnecessary duplication.9Minute Essay■What do you think about the pace of the class so far? Do you feel that you can get comfortable with the skills/concepts we introduce each class?■Interclass Problem - Take the object you animated previously and give it a new method called walkToward that takes an object as an argument. This method should have your character turn to face the thing it needs to walk toward and then take a step toward


View Full Document

TRINITY CSCI 1311 - Variables and Parameters

Course: Csci 1311-
Pages: 9
Documents in this Course
Arrays

Arrays

12 pages

Arrays

Arrays

10 pages

Applets

Applets

5 pages

Arrays

Arrays

8 pages

Methods

Methods

12 pages

Drawing

Drawing

8 pages

Load more
Download Variables and Parameters
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Variables and Parameters and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Variables and Parameters 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?