1.What is Processing?
Processing is a text editor sketchbook application and a language for coding. It is used to create visual elements with coding
2.What does IDE stand for? Describe its components.
IDE stands for Integrated Development Environment. It is an application that provides a text editor, a display window and a compiler.
3.What is a mode in Processing? Which is the default mode?
A mode for Processsing is the possibleilty for the sketchs to display on different platforms. The default for mode for Processing is Java
4.How do you save a file in Processing? What convention might you use?
You save a file in Processing by creating a folder for your edited text once you wanted to save.
5.How do you export a Processing file?
To export a file from Processing you have to go to File, then click Export Appilcation. The is for Lunix, Windows, and Mac OS.
6.What is a library? How do you access and use a library in Processing?
A library is a collection of references and information. In order to access the library you can scroll the navigation to the left side of the website to find the library. You can also import a library to the Processing console. You click the “Sketch” tab and then “add library”.
7.Where is the color picker in the Processing IDE?
The color picker in Processing IDE is in the “Tools” tab.
8.What do the circle, triangle and square shapes across the top of the Processing editor
Represent?
The shapes across the top of the Processing Editor represent play/action buttons for the console display. Circle/triangle = play & Circle/square = stop.
- How do you add and name an additional or new tab in the Processing editor?
To add/name an additional or new tab in the Processing editor is to click the triangle in the small square tab next to the title of your text project. From this you can choose to add a new tab and name it.
Coding Basics
- Describe the coordinate system in Processing.
The coordinate system of Processing is a plain the is used to plot the points of the objects you create. Objects are plotted on a X,Y axis in the Processing editor.
- What is the difference between an active and static sketch? Use code to demonstrate your response.
An active sketch is one where there is movement within the display. An static sketch is one where the displayed object doesn’t move.
- What is the general syntax and structure for a line of code? Use code to demonstrate your response.
The general syntax for a line of code is for the function
ellipse(6,3,90,40);
- What is the general syntax and structure for a block of code? Use code to demonstrate your response.
Void setup() {
Size (400,400);
}
- Why are certain words in different colors in the Processing editor?
The words are different colors to represent the different actions that they take.
- What is a system or reserved word in Processing? Give an example.
Certains words in Processing are different colors because they are defined words within the program. This means the Processing sees these words to mean something special/different to the program and usually have a purpose. EX: draw = display; float = variable for movement
- How does order matter in Processing. Give an example demonstrated with code.
Order matters in Processing because functions are called in the order they are in within the display. The computer will read it in the order that it is documented.
EX: void draw() {
background(col);
ellipse(30,30,100,100);
rect (30, 30, 100, 100);
}
- What is the difference between mousePressed and mousePressed()? Use code to demonstrate your response.
The difference between the two is that mousePressed is a stored variable and mousePressed is a function.
EX: mousePressed == true
mousePressed() {
If (background (col)); {}
Else {
}
}
- What called function must always be first in setup()?
The function that should always be in setup() is size().
- What is the difference between an inline comment and a block or multi-line comment? Use code to demonstrate your response.
An inline comment can only be used within the line of code it is on. Everything printed after the // will not be printed. A block or multi-line comment can be used across many lines of codes. Block comments can be closed with /**/
EX: Inline = // I used the function to call the variable
Block = /* enters the number with the loop*/
- Does whitespace matter in Processing? Capitalization? Use code to demonstrate your response.
Whitespace does matter in Processing because the system may read words differently than another. Words or numbers place together can be read as one in the editor. Capitalization matters because the system will read two words instead of one.
Variables, Operators, Logic
- What is a variable? What is a data type? What is a value?
A variable is used for storing data. A data type is a representation of an item. A value is a generic holder.
- What is the difference between a system variable and one that you define? Use code to demonstrate your response.
A system variable is a variable that the system recognizes as specific value. A variable that is defined by the coder can be changed to represent a choice of values.
EX: setup();
Ycor = x;
- What is scope and how does it impact code? Use code to demonstrate your response.
Scope is when variables place a local locations such as within setup() and draw().
EX: Float xcor = 4;
Float rcol = 255;
Void setup() {
size:(400, 400);
}
Void draw () {
stroke();
}
- What does it mean to declare, initialize and use a variable? Use code to demonstrate your response.
To declare a variable you set it up at the top of your code. To initialize and use your variable you have to place it in a line of code to be called by a function.
EX: float rcol = 5;
Void setup() { size( 200, 200) }
Void draw () { circle( 55, 66);
Fill (rcol, 0, 0); }
- What happens when a variable is attempted to be accessed outside of its scope?
When a variable is outside of its scope and tried to accessed it comes back as an error.
The console won’t be able to read it.
- What happens when a variable is declared globally, but is not used?
A global variable that is declared in the program but is not used will not print to the display.
- What value does float nums; have?
The value that float nums has is a value that has a float statement.
- What are operators in Processing? Use code to demonstrate your response using at least one operator.
Operators in Processing are used to create value or actions with equations.
EX: int h = 4 / 5;
- What is a boolean data type?
A boolean data type is a type that only has two outcomes. This can result is either a true or false statement.
- List three primitive data types.
3 primitive data types are boolean, float, and int.
- Write a code example that increments a value by 5.
X = speed + 5;
- Describe the order of operations for: x = speed * 40;
X is equal to the variable of speed multiplied by 40 pixels. The object is set to move by 40 times the movement set by the variable speed.
- Write a code example that decreases a value by one using shorthand.
X = speed–
- What does the logical operator ! do?
Control, Iteration, Structure
- What is an if statement? When should it be used? Use code to describe its syntax.
- How many ifs can be used in an if statement?
- What is the difference between else and else if? Use code to demonstrate your response.
- What is the difference between code with several consecutive if statements and code with several else if statements?
- What is a while loop? When should it be used? Use code to describe its syntax.
- What is a for loop? When should it be used? Use code to describe its syntax.
- Write code that uses a nested for loop to draw a grid of squares across the x and y axis of a canvas.
Functions
- What is a function?
- What is the difference between a function or method built into Processing and one that you define?
- What does the keyword void mean?
- What does the keyword return mean?
- Write code that uses the keyword return.
- Write code that used a defined function (by the user) and call or use it.
- What is the distinction between function and method?
- What is the distinction between argument and parameter?
- What do the () in a function call or definition indicate?
- What will happen if you call an undefined function?
- What will happen if you define a function, but do not call or use it?
- What concept are functions useful for?