stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
FinalExamReview in Processing Flashcards | StudBud
Explore
/
FinalExamReview in Processing
FinalExamReview in Processing
38 terms
·
StudBud Administration
·
176 plays
multiple choice review on main programming concepts in Processing.
Flashcards
38 cards
F
Practice quiz
P
Host live
L
Questions
38
Answers
1
Consider this line:
strokeWeight (5);
This line declares a stroke line 5 pixels thick
This line declares a stroke line as 5 pixels long
This line declares the stroke color as Red
This line declares a stroke color as Blue
2
How do
x
and
y
change when moving an object down - left on the screen
both x & y increase
x increases, y decreases
both x & y decrease
x decreases, y increases
3
What does the fourth number control:
fill (255,0,10,210);
the hue
the saturation
the red color
the transparency
4
What is the missing line of the following program that outputs 0, 10, 20, 30, 40, etc.
x = x + 10;
x +10;
x ++;
x== x + 10;
5
If
y
is from type
int
, what does this statement do:
y = 32%4+5*2
It checks to see if y is equal to 10
It stores 10 in thevariable y
It outputs 18
It stores 18 in the variable y
6
What is the missing part in the following code that will make the ball bounce off the walls:
||
&&
The ball will never bounce, Error in calculating the speed
The ball will never bounce, Error in the conditions
7
For the following array, complete the code that calculates the cube of each element
nums[i] = pow (nums[i],3);
nums[i] = nums[i]*3;
nums = pow (nums,3);
pow (nums[i], 3);
8
In the following array,which statement will print
May
println ( months[4]);
println ( months[5]);
println ( months[6]);
println ([5]);
9
A computer code used for converting numbers to characters from the English Alphabet
ASCII
binary
Hex
ASC
10
What will be printed as a result of the following statements:
Hello
Hello Mrs G
Bye Mrs G
will not print anything - Error
11
CPU
stands for:
Control Protocol Unit
Computer Programming Utility
Computerized Performance Utility
Central Processing Unit
12
Will the result of the program below change, if
background(0);
is moved to the draw function ?
it will fade the text gradually with speed 50 ms
it will show the text with size 50 pixels
no difference, both will draw a black background
it will erase the previous letters drawn on the screen
13
Which is the correct way to set a for loop from 500 to 1000 with a step 5:
for (int i=500; i<1005, i+=5)
for (int i=1000;i>500; i++)
for (i = 500, i<1005, i+5)
for (int i=500; i>1005, i+=5)
14
In Processing :
draw() is executed continuously,but setup()is not necessary
draw() is executedcontinuously and setup() - only once
setup() and draw() are executed only once
setup() and draw() are executed continuously
15
What does this code output?
7
8
6
5
16
Output devices …
make the processed information available for use
allow data & user responses to be enteredinto a computer
consist of electronic components that storedata
contain electronic circuits that causeprocessing to occur
17
Which is a correct use of an
else
statement:
} else (key == ’N’ || key == ’n’) {
} else (key == ’N’) {
} else() {
} else {
18
The motherboard is a piece of hardware that:
is also named CPU and is where most calculations take place
stores all the information
supplies the electricalpower for the whole computer
interconnects all the hardware inside a computer - CPU, RAM
19
A kilobyte is approximately:
one million bytes
one billion bytes
one thousand bytes
one trillion bytes
20
Small, very fast, and very expensive memory, that is included inside the CPU:
CACHE
PRE FETCH
RAM
REGISTER
21
Which command will allow you to draw a rectangle using its width & height :
rect (x
1
, y
1
, w, h)
rectMode(CENTER);
rectmode(CORNER);
rectmode(CORNERS);
rectMode(RADIUS);
22
If you want to move an object to the right with an arrow key, which condition will you choose:
key== CODED && keyCode==RIGHT
keyPressed && key == CODED
key== CODED
keyCode== RIGHT
23
A digital interface connecting computers to TVs and LCDs - transmits audio and video signals
VGA
DVI
USB
HDMI
24
What is the missing code in the following program :
Error, Dice is not declared correctly
int Sum = 0;
int Sum;
int Sum = 1;
25
What should you write in a program to cause the entire screen to become gray?
background(150);
noBackground();
grayBackground();
Background(150);
26
In order to
check if the user inputs the integer 5
you need to use this statement:
if( int(key) ==5 ) {
if( int(key) - 48 == 5 ) {
if ( key ==5 ) {
if (key - 48 = 5) {
27
What will be the printed after the following code is executed
Error
7
11
4
28
Apple
introduced the Macintosh computer, which significance was that:
it’s the first computer with Graphical User Interface
a) it’s the firstassembled “ready-made” machine
it contains transistors, replacing vacuum tube
it was the first computer to do nuclearphysics calculations
29
If
sum = 60
and
count = 4
,what will be the output of
print (“The total average is:”,sum/count);
The total average is: 15 is printed on the screen
The total average is: 15 is printed on the console
Nothing is printed, because it’s a comment
Syntax Error
30
Which
call
of the following function is correct:
num = void collision (2,4,6,8);
void collision (x1,y1,x2,y2);
There is an Error in function declaration
num = collision (2,4,6,8);
31
One of the following variables is NOT declared correctly:
int counter = 6 ;
Boolean state = 1;
char answer = ‘N’;
float yRef = 5.0 ;
32
A printer,speakers, and head phones, are all considered:
input devices
processing devices
network devices
output devices
33
In Processing the difference between System and Custom variables is that:
Custom vars are type float andSystem vars are type int
Custom vars are type int andSystem vars are type float
Custom require declaring and the System don’t
System require declaring and the Custom don’t
34
A logic error in a program will:
make the program print Error messages
produce an unexpected result
stop the program from running
cause syntax issues
35
How many bits are there in one byte?
8
16
64
4
36
The elemental language of computers, comprising a long sequence ofbinary digital zeros and ones
binary
machine language
ASEMBLY
low-level language
37
The procedure of making an extra copy of user data in case the originalis lost or damaged is
defragmenting
partitioning
backing up
disk diagnosting
38
A special program that processes code written in particular language and turns it into binary
IDE environment
translator
utility program
compiler