Visual Basic - Quiz on Chapter #1 - #4

True/False and Why

 

For all of the following questions answer True or False - for all things you designate as False, you must give a WHY. The WHY needs to specifically correct the statement.

1. T / F

With a check box, the value property is 0 if checked, 1 if unchecked and 2 if grayed (disabled).

2. T / F

Your textbook recommends using double as the data type for decimal fractions and business applications.

3. T / F

The order of the focus as you tab through a form is determined by the TabIndex property.

4. T / F

Global variables are accessible from all procedures of a form. They are defined in the General Declarations section of the form.

5. T / F

The IsNumeric function can be used to check to see if a field is numeric. It returns True or False.

6. T / F

When you pause while drawing a text box, a tool tip will give you the size of the control in twips (one twip is 1/1440 of an inch).

7. T / F

If code is A add to count1. If code is B add to count2. Otherwise add to count3. This problem can be coded using a compound OR.

8. T / F

You can define access keys so that your projects respond to keyboard strokes. This is done by typing a & in front of the first character in the caption statement. This can only be done with the first character.

9. T / F

An empty or null string has no space between the quotes.

10. T / F

Constants that are built into VB are called named constants.

11. T / F

You should create an option button by double-clicking on the toolbox tool, and then dragging it into the frame.

12. T / F

Memory locations that hold data that cannot be changed during execution are called constants and memory locations that hold data that can be changed during execution are called variables. The name you use when declaring variables and constants is called an identifier.

13. T / F

Setting the Startup Position property of the form to Center Screen means that the contents of the form will be centered on the form.

14. T / F

When you call an event procedure, the word Call is required.

15. T / F

The position of the form on your desktop when the execution of the project begins is determined by the position of the form in the layout window.

16. T / F

Variables that are not declared with a Dim are implicitly declared and are assigned a data type of Standard which can hold strings, numbers and several other kinds of information.

17. T / F

If you code a With object name and an End With, all statement between relate to that object.

18. T / F

UpperCase(string) will return the uppercase equivalent of a the specified string.

19. T / F

The default property on a label is text and on a check box it is value.

20. T / F

Two strings can be combined to form a new string consisting of the original strings joined together. This is called concatenation and the symbol used is the &.

21. T / F

Numeric literals should not be enclosed in quotes and True and False which are special key terms should not be enclosed in quotes when assigning them to the object property.

22. T / F

The underscore character is a line continuation character. It must be preceded by a space.

23. T / F

The TabStop property determines whether a control can receive focus.

24. T / F

If chkFirst.Value = True Then

MsgBox "Checked"

End If

If chkFirst is checked on the form, the Message Box will appear.

25. T / F

Carriage control and line feed can be handled using vbChrLf or by using Chr(13) & Chr(10).

26. T / F

The stretch property can be set to true to make the picture fill the control.

27. T / F

When a compound expression has both AND and OR the evaluation is done from left to right and which ever is encountered first is resolved first.

28. T / F

If you set a command buttons cancel property to true, it becomes the cancel button which is selected with the escape key is pressed.

29. T / F

FormatCurrency creates a value that is a pure number and canbe used in future calculations.

30. T / F

With nested IF statements, the END IF statements are all grouped at the bottom.

31. T / F

The project file holds the code that you write as well as information about the objects and their properties.

32. T / F

The VAL function converts blank values to null.

33. T / F

To set common properties for a group of controls. For example you could select 3 text boxes and then go to properties and set the appearance property to flat. This will now apply to all 3 text boxes. You can then go back and change one appearance to 3D and the others will remain flat.

34. T / F

If you select 3 text boxes as a group and then you go to Format on the main menu and choose Make Same Size you can select either height, width or both. All the boxes will have the same size.

35. T / F

Good programming says that before you do a calculation, you use the Val function to convert the property of a control to its numeric form.

36. T / F

An ELSE statement always provides the alternative to the last unmatched IF statement.

37. T / F

Intrinsic constants have a prefix (2 characters) to tell the source. For example vb indicates the source is Visual Basic.

38. T / F

In assignment statements, the value that appears on the left of the equal sign is assigned to the property on the right of the equal sign.

39. T / F

To set the alignment property of text boxes to change the alignment, you must also set the multiline property to False.

40. T / F

Open "filespec" for Input As #n will open a file, Input #n var will read one piece of data from the file and Close #n will close the file. The variable in the input statement should be the same type as the data from the file.

41. T / F

The ANSI code for HELLO is 72 69 76 76 79.

42. T / F

If code is A and amount is greater than 50 add amount to the total. If code is A and amount is not greater than 50 put out a message box. If code is not A do nothing. This problem can be coded with a simple compound AND.

43. T / F

Methods are actions associated with objects.

44. T / F

Mathematical formulas are resolved using the rules for the mathematical order of operations.

45. T / F

The following statement will accumulate the total of wrkAns in wrkTot:

wrkTot = wrkAns

46. T / F

To make a picture invisible at run time, you can set the visible property to false. This can only be done at design time; it cannot be done at run time.

47. T / F

Scope is the visibility of a variable. A local variable is available only in the procedure in which it was declared. A local variable has a lifetime normally of one execution of the procedure in which it is located.

48. T / F

A procedure cannot call another procedure.

49. T / F

Visual Basic is not case sensitive when comparing strings.

50. T / F

Setting the default property on a command button to true makes it the default button. This means then when the user presses enter, that button is selected automatically.

Based on the textbook Programming in Visual Basic 6.0 by Bradley and Millspaugh which is the assigned text. Some questions are quotes from this text.