Ch 2 Practice Test1

Embed Size (px)

Citation preview

  • 7/28/2019 Ch 2 Practice Test1

    1/2

    Visual Basic Name -

    Ch. 1 & 2 Practice Test Period -

    True/False - Circle the numbers for the False exercises below. Leave the True exercises untouched.

    1. Information is stored in the CPU of a computer.2. The binary numbering system only includes the digits 0, 1, & 2.3. Six bits equals one byte.4.

    Visual Basic is an example of a procedural computer language.5. The Form Layout window lists the forms contained within a project.

    6. It is proper to use the name Form1 for a form in a project, especially if its the only form in the project.7. The Visual Basic Toolbar is usually found along the left edge of the screen.8. The Name property is one entry in the Properties window for a label object.9. You can double-click on an object's tool in the Toolbox to create an instance of that object on a form.10. The names of command buttons should be prefixed with cmd.11. A logic error will always occur if a programmer does not add the proper prefix to an object's name.12. A bug is an error in a computer program.13. You should always save the project before the form within the project.14. The proper file extension for a form file is ".vbf".15. The Explicit Option command should be a part of every program.16. A label can be positioned anywhere on a form by dragging it with the mouse during Run Time.17. Two double quotes typed next to each other such as "" represents the empty string.18. Print is an example of an event.19. The apostrophe ' is used to create comment statements.20. The End Sub statement is optional at the end of event procedures.

    Fill in the Blank - There may be more than one answer for certain questions but choose the best one.

    21.Name one property of a label object ____________________22.Name one property of a command button ____________________23.Name one event. ____________________24.Name one method. ____________________25. What prefix should be used when naming a form object? ____________________

    Write a Visual Basic statement or code segment that performs the following task.

    26. Write a statement that displays the message "Hi Dad" in a message box and "Hi Mom" on a separateline of the same message box.

    27. Write a statement that sets the Caption property of a command button named Command1 to the phrase"Click" but make sure that the letter C is underlined.

    28. Write a statement that sets the background color of a label named Label1 to the color green.

  • 7/28/2019 Ch 2 Practice Test1

    2/2

    29. Write a statement that unloads a form named Form1.

    30. Write a statement that displays the message "Main Form" in the Caption of a form named Form1.

    31. Write a complete Activate event procedure for a form named Form1 that would set the backgroundcolor of a label named lblMessage to the color yellow.

    32. Write a complete Click event procedure for a command button named cmdExit that would unload theform named Form1 when the user clicks the command button.

    Essays Answer each question as completely as possible in an essay. Write you essays on lined paper and

    staple the paper to this practice test.

    33. What are the three steps to writing a VB project?34. What are the three kinds of VB errors explained in our study of Chapter 2? Explain the characteristics

    of each kind of error and give an example of each one if possible.

    35. Explain the differences between design time, break time, and run time? You may identify physicaldifferences in the VB environment as well as what a VB programmer is allowed or not allowed to doduring each of these "times".