stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
FinalExamReview2024 Flashcards | StudBud
Explore
/
FinalExamReview2024
FinalExamReview2024
28 terms
·
StudBud Administration
·
17 plays
multiple choice review on main programming concepts in Processing.
Flashcards
28 cards
F
Practice quiz
P
Host live
L
Questions
28
Answers
1
What will be printed as a result of the following statements:
Bye Mrs G
will not print anything - Error
Hello
Hello Mrs G
2
Which
call
of the following function is correct:
num = collision (2,4,6,8);
void collision (x1,y1,x2,y2);
There is an Error in function declaration
num = void collision (2,4,6,8);
3
A special program that processes code written in particular language and turns it into binary
compiler
translator
IDE environment
utility program
4
In the following array,which statement will print
May
println ([5]);
println ( months[4]);
println ( months[5]);
println ( months[6]);
5
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 the conditions
&&
||
The ball will never bounce, Error in calculating the speed
6
How do
x
and
y
change when moving an object down - left on the screen
x increases, y decreases
x decreases, y increases
both x & y decrease
both x & y increase
7
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) {
8
In Processing the difference between System and Custom variables is that:
System require declaring and the Custom don’t
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
9
For the following array, complete the code that calculates the cube of each element
nums = pow (nums,3);
nums[i] = pow (nums[i],3);
nums[i] = nums[i]*3;
pow (nums[i], 3);
10
Will the result of the program below change, if
background(0);
is moved to the draw function ?
it will erase the previous letters drawn on the screen
it will fade the text gradually with speed 50 ms
no difference, both will draw a black background
it will show the text with size 50 pixels
11
Consider this line:
strokeWeight (5);
This line declares a stroke color as Blue
This line declares a stroke line as 5 pixels long
This line declares the stroke color as Red
This line declares a stroke line 5 pixels thick
12
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 18 in the variable y
It outputs 18
It stores 10 in thevariable y
13
What will be the printed after the following code is executed
7
11
4
Error
14
What is the missing line of the following program that outputs 0, 10, 20, 30, 40, etc.
x ++;
x = x + 10;
x== x + 10;
x +10;
15
The procedure of making an extra copy of programs in case the original is lost or damaged:
forking
backing up
partitioning
saving
16
What does the fourth number control:
fill (255,0,10,210);
the saturation
the hue
the red color
the transparency
17
In Processing :
setup() and draw() are executed only once
draw() is executed continuously,but setup()is not necessary
setup() and draw() are executed continuously
draw() is executedcontinuously and setup() - only once
18
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
19
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
20
What should you write in a program to cause the entire screen to become gray?
Background(150);
noBackground();
background(150);
grayBackground();
21
What does this code output?
5
7
6
8
22
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
23
What is the missing code in the following program :
int Sum = 1;
int Sum = 0;
int Sum;
Error, Dice is not declared correctly
24
Which command will allow you to draw a rectangle using its width & height :
rect (x
1
, y
1
, w, h)
rectMode(RADIUS);
rectmode(CORNERS);
rectmode(CORNER);
rectMode(CENTER);
25
One of the following variables is NOT declared correctly:
int counter = 6 ;
float yRef = 5.0 ;
Boolean state = 1;
char answer = ‘N’;
26
A computer code used for converting numbers to characters from the English Alphabet
binary
Hex
ASC
ASCII
27
Which is a correct use of an
else
statement:
} else (key == ’N’) {
} else {
} else() {
} else (key == ’N’ || key == ’n’) {
28
Which is the correct way to set a for loop from 500 to 1000 with a step 5:
for (i = 500, i<1005, i+5)
for (int i=500; i>1005, i+=5)
for (int i=1000;i>500; i++)
for (int i=500; i<1005, i+=5)