Learn to Program using Alice

Practice Test for the Lesson Titled

World-Level Methods

Published:  May 23, 2007
Last updated:  July 3, 2007
By Richard G. Baldwin

File: Alice0145PracticeTest.htm


Questions

1.  True or False:  You can define new methods at either of two levels in Alice:

Answer and Explanation

2.  True or False:  All world-level methods require incoming parameters.

Answer and Explanation

3.  True or False:  Method parameters are used to instruct a method that knows generally how to behave how it should specifically behave as a result of a specific call to the method.

Answer and Explanation

4.  True or False:  To declare a parameter for a method in Alice, you must

This will cause the Create New Parameter dialog to appear on the screen, which you must then populate.

Answer and Explanation

5.  True or False:  When declaring a method parameter in Alice, as a minimum, you must specify:

Answer and Explanation

6.  True or False:  All of the twenty primitive methods that are available in the methods tab for all objects can be called on incoming method parameters of type Object.

Answer and Explanation

7.  True or False:  All of the custom methods that are available in the methods tab for a particular object can be called on the incoming method parameter when an object of that type is passed to the method.

Answer and Explanation

8.  True or False:  When you pass an object as a parameter to a method, the methods that can be called on the incoming object parameter are limited to sixteen of the twenty primitive methods that are available for all objects (other than the world object), plus five special methods that can be used to set the values of the following five properties that are common to all objects other than the light, camera, and world objects:

Answer and Explanation

9.  True or False:  To use the value of a method parameter in code that you write in the method, simply drag the name of the parameter down and drop it into the appropriate location in the statement that you are writing.

Answer and Explanation

10.  When programmers break up a large problem into smaller units, they are applying the principle of _________.

Answer and Explanation

11.  The representation using English-like statements of a solution to a programming problem, is called ________.

Answer and Explanation

12.  A step by step procedure for solving a problem is called ________.

Answer and Explanation

13.  The term syntax refers to grammar rules that you must follow when:

Answer and Explanation

14.  A file that contains high level language code is called:

Answer and Explanation

15.  Given the Alice code shown in Figure 145-115, what output is produced by the print statement?

Figure 145-115.
public void main ( ) {
  String myFirstName = David-; 
  String myLastName = Smith; 
  String y = default string;
    y .set( value , ( myFirstName + myLastName ) );
  print( y );
}

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 15

C. the value of world.main.y is David-Smith

Explanation 15

Back to Question 15


Answer 14

C. a source file

Explanation 14

Back to Question 14


Answer 13

C. coding in a high-level language

Explanation 13

Back to Question 13


Answer 12

D. an algorithm

Explanation 12

Back to Question 12


Answer 11

A. pseudocode

Explanation 11

Back to Question 11


Answer 10

C. modularization or modular design

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

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

True

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-