Learn to Program using Alice

Practice Test for the Lesson Titled

Data Types and Variables

Published:  May 21, 2007
By Richard G. Baldwin

File: Alice0140PracticeTest.htm


Questions

1.  True or False:  Alice is a type-insensitive programming language.

Answer and Explanation

2.  True or False:  Of the fifteen types supported by Alice, four are somewhat general purpose types and the remainder are more specialized types.

Answer and Explanation

3.  True or False:  You should just ignore the Transformable data type.

Answer and Explanation

4.  True or False:  The most significant distinguishing characteristic of data of the type Number is that you cannot perform arithmetic using that data.

Answer and Explanation

5.  True or False:  Alice subdivides the general numeric type into six different types, some of which are whole (integer) values, and some of which are allowed to have fractional parts.

Answer and Explanation

6.  True or False:  Alice treats all numeric types as the single type Number.

Answer and Explanation

7.  True or False:  The Boolean type is probably the simplest of all types in that data of this type can only have one of three different values: true, false, or maybe.

Answer and Explanation

8.  True or False:  In Alice, data of the Boolean type originates primarily as a result of tests that compare one thing with another.

Answer and Explanation

9.  True or False:  Data of type Object contains references to objects on which you can call methods and functions.

Answer and Explanation

10.  True or False:  You can create variables of the Object type and save references to objects in those variables.

Answer and Explanation

11.  True or False:  Typically, data of type String contains what might be thought of as a label in the non-technical world.

Answer and Explanation

12.  True or False:  If you store a telephone number as type String, you can perform arithmetic using that data provided that it consists solely of the digits from 0 through 9 inclusive.

Answer and Explanation

13.  True or False:  It is possible to create new types in Alice.

Answer and Explanation

14.  True or False:  Every local variable in Alice is identified as belonging to a specific type.  This means that the memory that has been set aside to be used as a variable can only be used to store a specific type of data.

Answer and Explanation

15.  True or False:  All programming languages, including Alice, require data to be categorized into different types.

Answer and Explanation

16True or False:  A variable is a place in memory where data of a specific type can be stored for later retrieval and use.

Answer and Explanation

17True or False:  While each variable is given a name, it is not necessary that those names be unique.

Answer and Explanation

18True or False:  In Alice, variables can exist in at least two different locations in a program:

Answer and Explanation

19True or False:  Variables that exist inside an object but outside of a method or function are called properties in Alice.

Answer and Explanation

20True or False:  Local variables can be used to carry data forward from one method call to the next call to the same method.

Answer and Explanation

21True or False:  Properties belonging to an object exist during the entire running time of the program.

Answer and Explanation

22True or False:  Unlike local variables, property variables are not identified with a specific type.

Answer and Explanation

23True or False:  Once they have been declared, except for the fact that they have a much longer lifetime, the procedures for using property variables is pretty much the same as the procedures for using local variables.

Answer and Explanation

24True or False:  When you create a new variable in Alice, you must specify the name and type of the variable.  You can optionally specify an initial value or accept the default initial value.

Answer and Explanation

25True or False:  Whenever you need to use a local variable in your program code, you drag it down and drop it at the appropriate location in the program code.

Answer and Explanation



Copyright 2007, Richard G. Baldwin.  Faculty and staff of public and private non-profit educational institutions are granted a license to reproduce and to use this material for purposes consistent with the teaching process.  This license does not extend to commercial ventures.  Otherwise, reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.


The following image is the splash screen from Alice 2.0, and is the property of the developers of Alice at Carnegie Mellon.

Answers and Explanations


Answer 25

True

Explanation 25

Back to Question 25
 


Answer 24

True

Explanation 24

Back to Question 24
 


Answer 23

True

Explanation 23

Back to Question 23
 


Answer 22

False

Explanation 22

Back to Question 22
 


Answer 21

True

Explanation 21

Back to Question 21
 


Answer 20

False

Explanation 20

Back to Question 20
 


Answer 19

True

Explanation 19

Back to Question 19


Answer 18

True

Explanation 18

Back to Question 18


Answer 17

False

Explanation 17

Back to Question 17


Answer 16

True

Explanation 16

Back to Question 16


Answer 15

False

Explanation 15

Back to Question 15


Answer 14

True

Explanation 14

Back to Question 14


Answer 13

True

Explanation 13

Back to Question 13


Answer 12

False

Explanation 12

Back to Question 12


Answer 11

True

Explanation 11

Back to Question 11


Answer 10

True

Explanation 10

Back to Question 10


Answer 9

True

Explanation 9

Back to Question 9


Answer 8

True

Explanation 8

Back to Question 8


Answer 7

False

Explanation 7

Back to Question 7


Answer 6

True

Explanation 6

Back to Question 6


Answer 5

False

Explanation 5

Back to Question 5


Answer 4

False

Explanation 4

Back to Question 4


Answer 3

True

Explanation 3

Back to Question 3


 

Answer 2

True

Explanation 2

Back to Question 2


Answer 1

False

Explanation 1

Back to Question 1


Copyright 2007, Richard G. Baldwin.  Faculty and staff of public and private non-profit educational institutions are granted a license to reproduce and to use this material for purposes consistent with the teaching process.  This license does not extend to commercial ventures.  Otherwise, reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.

The following image is the splash screen from Alice 2.0, and is the property of the developers of Alice at Carnegie Mellon.

-end-