Learn to Program using Alice

Practice Test for the Lesson Titled

Functions that Return Values

Published:  May 19, 2007
By Richard G. Baldwin

File: Alice0135PracticeTest.htm


Questions

1.  True or False:  Alice has both methods and functions.

Answer and Explanation

2.  True or False:  In Alice, methods return values and functions do not return values.

Answer and Explanation

3.  True or False:  Only those objects created from the classes in the gallery provide primitive functions.

Answer and Explanation

4.  True or False:  You can create a new function and attach it to any of the Alice objects.

Answer and Explanation

5.  True or False:  Alice is a so-called "type insensitive" programming language.  Therefore, Alice does not require different kinds of data to be categorized in different ways, technically known as data types.

Answer and Explanation

6.  True or False:  You cannot do arithmetic with a value of type Number.

Answer and Explanation

7.  True or False:  The String type might be described as a series of characters that are used to create something that in the non-technical world might be called a label.

Answer and Explanation

8.  True or False:  The primitive say method requires a single parameter, and it must be type Number.

Answer and Explanation

9.  True or False:  The world provides a function named toString that can be used for converting data from type Number to type String.

Answer and Explanation

10.  True or False:  The process of fusing two or more strings into a single String in computer programming jargon is concatenating strings.

Answer and Explanation

11.  True or False:  Alice does not provide a function that can be used to concatenate strings.

Answer and Explanation

12.  True or False:  Assume that you have a world containing a Coach object and that you need to create a new function for that object.  The steps for creating the new function would be as follows:

This will produce a dialog that allows you to specify several important aspects and to complete the creation of the new function.

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 12

False - use functions tab, not methods tab and properties tab.

Explanation 12

Back to Question 12


Answer 11

False

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

False

Explanation 8

Back to Question 8


Answer 7

True

Explanation 7

Back to Question 7


Answer 6

False

Explanation 6

Back to Question 6


Answer 5

False

Explanation 5

Back to Question 5


Answer 4

True

Explanation 4

Back to Question 4


Answer 3

False

Explanation 3

Back to Question 3


 

Answer 2

False

Explanation 2

Back to Question 2


Answer 1

True

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-