Arithmetic Operations in ActionScript3

Self Test

Think of the answer to each question, then hold the mouse over the answer button to see the answer.

1. What value is assigned to num: num=4%1; 0

2. What value is assigned to num: num=(2+4)*3; 18

3. What value is assigned to num: num=8%5; 3

4. The statement x=5; is called an _____ statement. assignment

5. What value is assigned to num: num=7+5*0; 7

6. What is the value given to num num=Math.pow(2,3); 8: 2x2x2 (raises 2 to the 3rd power)

7. What value is assigned to num: num=(5+6)*1; 11

8. What value is assigned to num: num=9+2*6; 21

9. The % operator gives the ____ remainder

10. What value is assigned to num: num=(7+9)*2; 32

11. What value is assigned to num: num=(7+7)*4; 56

12. What is the value given to num in the following: n=8; num=--n; num will be 7 (n is decremented BEFORE num gets a value)

13. What does the statement x++; do? adds 1 to x (increments x)

14. Write the statement to assign the square root of n to num. num= Math.sqrt(n);

15. What value is assigned to num: num=8%7; 1

16. What value is assigned to num: num=6%1; 0

17. What value is assigned to num: num=7+9*0; 7

18. What is the value given to num in the following: n=1; num=n++; num will be 1 (n is incremented AFTER num gets a value)

19. What value is assigned to num: num=6+2*2; 10

LESSON

INDEX

All of the Flash activities with description in Arabic, 汉语, English, Français, Deutsch, Indonesian, Italiano, 日本語, Portuguêes, Русский, Español,


Copyright © Hello World Publications. All rights reserved worldwide.

hello-world.com
Privacy
Policy

Site map

Hello-World