DMA60: Final Study Guide

Ace your homework & exams now with Quizwiz!

How to insert a comment that has more than one line?

/*This comment has more than one line*/

How can you add a comment in a Java?

//This is a comment

Array indexes start with:

0

What is the height of the following shape? ellipse(70, 120, 150, 180);

180

Which operator is used to assign a value to a variable

=

What will the following code return: Boolean(9 > 10)

false

How do you create a variable with the floating number 2.8?

float x = 2.8f;

How does a FOR loop start?

for (int i = 0; i < 5; i++)

How to write an IF statement for executing some code if "i" is NOT equal to 5?

if (i != 5)

How to write an if statement in Java?

if (i == 5)

How do you import the class file Array from the Java package?

import java.util.Arrays;

What is the correct way to declare and a assign a variable named j in Java with the integer value 2?

int j = 2;

Which method can be used to find the length of a string?

length()

How do you create a method in Java?

methodName()

Which of the following is an example of a built in variable in Processing?

mouseX

How do you call a function named "myFunction"?

myFunction()

What is a correct syntax to output "Hello World" in Processing?

print("Hello World");

Which keyword is used to return a value inside a method?

return

The area where all drawn graphics are displayed is known as the...

screen

Which of the following is not a shape?

stroke

Which method can be used to return a String in upper case letters?

toUpperCase()

When using 'RGB' to fill the color of a shape, the 4th parameter controls the __________ of the color.

transparency

How do you NOT declare a Processing variable?

variable carName;

How do you create a function in Java with no return type?

void myFunction()

How does a WHILE loop start?

while (i < 10)

What are the parameters in the 'size' function?

width and height

What, if anything, is the difference between function setup () and function draw()?

Function setup runs once and function draw is a loop.

______________ are lines of code that perform specific tasks.

Functions

Canvas matches with

HTML

Processing matches with

Java

p5 matches with

Javascript

How do you find the number with the highest value of x and y?

Math.max(x, y)

How do you round the number 7.25, to the nearest integer?

Math.round(7.25)

What is the correct way to create an object called myObj of MyClass?

MyClass myObj = new MyClass();

Which data type is used to create a variable that should store text?

String

What is the correct way to write a Java array? (declare variable colors and assign values for ordered elements red, green and blue)

String[] colors = {"red", "green", "blue"};

Which operator is used to add together two values?

The + sign

Is Java case-sensitive? Case-sensitive language means that language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.

Yes

By default, the color of the canvas is transparent. When you want to change the color of the canvas, you call which built-in function?

background

Which statement is used to stop a loop?

break

margin

CSS

Java is short for "JavaScript"

False

The value of a String variable can be surrounded by single quotes.

False


Related study sets

PrepU NSG204 Chapter 07: Legal Dimensions of Nursing Practice

View Set

Chapter 5 Integumentary System Adaptive Test

View Set

406 e2 ch.33. nonmalignant hemolytic disorders

View Set

Chapter 17 - Knowledge Test Questions

View Set

Abrams Clinical Drug Therapy prep-u final exam review

View Set