Background
jLogo Programming
- Commanding a Turtle
- Pseudocode
- Adding New Commands
- Iteration & Animation
- Hierarchical Structure
- Procedure Inputs
- Primitive Operators
- Defining Operators
- Words & Sentences
- User Interface Events
- What If? (Predicates)
- Recursion
- Local Variables
- Global Variables
- Word/Sentence Iteration
- Mastermind Project
- Turtles As Actors
- Arrays
- File Input/Output
Java
- A Java Program
- What's a Class?
- Extending Existing Classes
- Types
- Turtle Graphics
- Control Flow
- User Interface Events
Appendices
Updates
Lastly
Appendix A (Jargon)
- V -
- variable
-
A variable, in a computer program, is a container used to hold values. Variables have names, identifiers, and programming-language-dependent attributes.
The first kind of variables discussed in these lessons are inputs. Inputs, a.k.a. parameters, to Logo procedures and Java methods provide the power to describe a process (a set of steps) that does different things, depending on the argument(s) provided when the method or procedure is invoked.
All variables have an attribute called scope. What this means is where in your program's source code the variable may be accessed. As an example, inputs may only be referenced inside of the method/procedure they are defined in.
In Java, variables have a specific type attribute, e.g., int, boolean, a class identifier, etc... What you can do with the variable depends upon this type.
WikipediA has a comprehensive description of a variable in Computer Science.
- void
- Java is so particular about everything being of this type or that type that when there is NO type that makes sense, you must specify void as a data type. Methods must have a specified type when they are defined; it is part of their header. So, when a method is not going to return anything (it has NO type) the method is declared with void in its header where a valid type identifier would normally go.
Other jargon: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Back to HomePage