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