Graphics Programming using Allegro

Practice Test

Movable Text

Published:  September 7, 2008
By Richard G. Baldwin

File: Allegro00115PracticeTest


Questions

1.  True or False:  The clear_keybuf function can be called to store the character string "clear" in the keyboard buffer.

Answer and Explanation

2.  True or False:  A call to the makecol function with parameters of 0,0,0 returns the RGB value for black.

Answer and Explanation

3.  True or False:  Programs that you write using Allegro have access to an array of true/false data (named key) where the value in each element in the array represents the pressed/non-pressed state of one key on the keyboard.  If the key is pressed, the element contains a true value.  Otherwise, it contains a false value.

Answer and Explanation

4.  True or False:  Programs that you write using Allegro have access to an array of true/false data (named keyboard) where the value in each element in the array represents the pressed/non-pressed state of one key on the keyboard.  If the key is pressed, the element contains a false value.  Otherwise, it contains a true value.

Answer and Explanation

5.  True or False:  The numeric symbolic constant named key_down is the index for an element in an array named key that contains a value representing the pressed/non-pressed state of the down-arrow key.

Answer and Explanation

6.  True or False:  The symbolic constant named key_down is true whenever any key on the keyboard is pressed down.

Answer and Explanation

7.  True or False:  The code shown below draws "HELLO WORLD" in yellow text at the location specified by the x and y parameters.

    textout_ex(screen,
               font,
               "HELLO WORLD",
               x,
               y,
               makecol(255,255,0),
               -1 );

Answer and Explanation

8.  True or False:  The code shown below draws "HELLO WORLD" in red text at the location specified by the x and y parameters.

    textout_ex(screen,
               font,
               "HELLO WORLD",
               x,
               y,
               makecol(255,255,0),
               -1 );

Answer and Explanation

9.  True or False:  The call to the rest function shown below inserts a ten-millisecond delay in the execution of the program.

    rest(10);

Answer and Explanation

10.  True or False:  The call to the rest function shown below inserts a ten-second delay in the execution of the program.

    rest(10);

Answer and Explanation



Copyright 2008, Richard G. Baldwin.  Reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.

Richard Baldwin is a college professor (at Austin Community College in Austin, TX) and private consultant whose primary focus is a combination of Java, C#, and XML. In addition to the many platform and/or language independent benefits of Java and C# applications, he believes that a combination of Java, C#, and XML will become the primary driving force in the delivery of structured information on the Web.

Richard has participated in numerous consulting projects and he frequently provides onsite training at the high-tech companies located in and around Austin, Texas.  He is the author of Baldwin's Programming Tutorials, which have gained a worldwide following among experienced and aspiring programmers. He has also published articles in JavaPro magazine.

In addition to his programming expertise, Richard has many years of practical experience in Digital Signal Processing (DSP).  His first job after he earned his Bachelor's degree was doing DSP in the Seismic Research Department of Texas Instruments.  (TI is still a world leader in DSP.)  In the following years, he applied his programming and DSP expertise to other interesting areas including sonar and underwater acoustics.

Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.

Baldwin@DickBaldwin.com

 


Answers and Explanations


Answer 10

False

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

True

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 2008, Richard G. Baldwin.  Reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.

Richard Baldwin is a college professor (at Austin Community College in Austin, TX) and private consultant whose primary focus is a combination of Java, C#, and XML. In addition to the many platform and/or language independent benefits of Java and C# applications, he believes that a combination of Java, C#, and XML will become the primary driving force in the delivery of structured information on the Web.

Richard has participated in numerous consulting projects and he frequently provides onsite training at the high-tech companies located in and around Austin, Texas.  He is the author of Baldwin's Programming Tutorials, which have gained a worldwide following among experienced and aspiring programmers. He has also published articles in JavaPro magazine.

In addition to his programming expertise, Richard has many years of practical experience in Digital Signal Processing (DSP).  His first job after he earned his Bachelor's degree was doing DSP in the Seismic Research Department of Texas Instruments.  (TI is still a world leader in DSP.)  In the following years, he applied his programming and DSP expertise to other interesting areas including sonar and underwater acoustics.

Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.

Baldwin@DickBaldwin.com

 

-end-