Mid Term Quiz
Choose the *BEST* answer for each question in the context of our class
Sign in to Google to save your progress. Learn more
First and last Name *
What is an operator? *
What is a variable? *
When programming - when is a good time to use a for loop *
Which metaphor is most appropriate for explaining the purpose of a conditional statement *
When programming when is a good time to use a function? *
Why are events useful? *
What is an effective use of an array? *
What is a class? *
How do you refer to properties and methods within a class? *
Short answer
assume that all of the following expressions are written in order in the same program.
var donuts:Number = 2 + 4 * 5; *
 what is the value of donuts?
What is the type of the variable donuts? *
Refers to the question above
donuts += 1; *
assuming the value of donuts was 22 before what is the value after the above operation?
donuts = "donuts"; *
assuming we are in the same file - what is the value of donuts after the above expression?
trace(donuts); *
What is the result of the above expression?
What is the type of donuts now? *
for(var i = 0; i < 10; i++) *
what is the value of i at the end of the loop?
if ( donuts == "glazed donut") { trace("it's glazed"); } *
In english - what question is the if asking?
if ( donuts == "glazed") { trace("it's glazed"); } *
assuming all of the above expressions are part of the same program - will the trace statement execute?
function make_glaze_donut() :String { return "glazed donut"; } *
how do you call the above function?
function glaze_donut(a_donut:String) :String { return "glaze " + a_donut; } //notice this function is not the same *
What is the return type of the above function?
trace(make_glaze_donut());  //notice this is the first function *
what will the above expression print to the console?
trace(glaze_donut(donut)); //notice this is the second function *
what does this function return?
var bag_of_donuts:Array = ['glazed', 'powered', 'jelly', 'boston cream', chocolate glazed', 'plain']; *
what is the value of bog_of_donuts[0] ?
trace(bag_of_donuts.length); *
what would this print to the console?
var donut_maker:DonutMaker = new DonutMaker(); *
What does the above statement do?
Assuming DonutMaker has a "make" method - how would you call it? *
Evaluate logical expressions
This is something you all have to know and get good at.  So here are a few problems:
All of the following are Boolean Operators: && (and), || (or), ! (not) *
Which actionscript logical expression correctly determines whether the value of some_number lies between 0 and 100? *
(4 >= 4 && 8 < 1) *
Will the above return true or false?
!(4 >= 4 || 8 < 1) *
Will the above return true or false?
( (4 >= 4 && 8 < 1) || (44 == 33 || 5 > 3) ) *
Will the above condition return TRUE or FALSE? (This is a tough one, just think about it)
If p is a Boolean variable, which of the following logical expressions always has the value FALSE? *
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google.