REVIEW FOR LESSON 4 Variables

6 Slides89.10 KB

REVIEW FOR LESSON 4 Variables

1. WHAT IS THE BEST DEFINITION FOR A VARIABLE? A. B. C. D. A number A letter that stands for any number A placeholder for something else A permanent constant for a number or word

2. WHAT DOES THE TRACE STATEMENT WRITE TO THE OUTPUT WINDOW? VAR N:NUMBER 10; VAR T:NUMBER 25; TRACE (N T); A. B. C. D. N T 35 10 25

3. WHAT DOES THE TRACE STATEMENT WRITE TO THE OUTPUT WINDOW? VAR N 25-3 2; TRACE (N); A. B. C. D. Nothing because there is an error – n can only be one number n 20 24

4. THE BOX MOVIECLIP HAS BEEN EXPORTED FOR ACTIONSCRIPT WITH THE CLASS NAME BOX. WHAT IS THE CORRECT WAY TO ADD AN INSTANCE OF THE BOX MOVIE CLIP TO THE STAGE JUST USING ACTIONSCRIPT? A. var myMovie:MovieClip; addChild(myMovie); B. addChild(Box); C. var myBox:MovieClip; myBox new Box(); addChild(Box); D. var myMovie:MovieClip; myMovie new Box(); addChild(myMovie);

5. THE EQUAL SIGN ( ) CAN MEAN MORE THAN JUST ‘BOTH SIDES OF THIS EQUATION ARE EQUAL.’ IN PROGRAMMING IT CAN MEAN AN ASSIGNMENT IS BEING MADE. KNOWING THIS, CAN THE CODE BELOW WORK: VAR T:NUMBER 5; T T 2; TRACE(T); A. B. C. D. No, because t equals 5 and 5 does not equal 7 Yes, because first you evaluate the code on the right then put it into the on the left No, because 5 5. It can’t equal a different number. I’m confused.

Back to top button