Sunteți pe pagina 1din 3

Critical Thinking Chapter.

1. Describe how the windows, components, and the features of the Visual Basic
IDE are used to develop, run, and debug an application.
A: Drag a control from the tool bar into the design er then code the
component to do a certain action then run it with debugger to make sure
there is no errors.
2. Indicate what would be displayed if each of these expressions were assigned
to a label:
A) 10 + 3 6 A: 7
B) 2 ^ 3 + 5 * 4 A: 28
C) 4 + 3 * 2 A: 10
D) 2 + 9 ^ (1 / 2) A: 5
E) 15 * 2 + 4 A: 34
F) 15 * (2 + 4) A: 90
G) 2 + 4 / 2 + 1 A: 5
H) 5 3 ^ 2 + 1 A: -3
I) 15 / 3 + 2 A: 7
J) 6 + 3 2 A: 6 + 3 2
K) 2 + 9 ^ 1 / 2 A: 6.5
L) 5 3 ^ (2 + 1) A: -22
3. Explain the term event-driven.
A: Executes code in response to events like a click.
4. List the controls presented in this chapter and explain if and how the user can
interact with each one.
A: A button to click, GroupBox to class an object to a form, Label to write
anything, MenuStrip to add an application, RadioButton to select something.
5. List at least one difference in the way a form looks between the Design
window and at run time.
A: The outlines to resize the controls.
6. List two ways to terminate a running application.
A: Click the close button in the upper right corner or code an exit command
7. Explain the difference between the (Name) and text properties of a control.
A: The (name) is what the computer uses and the text is what the reader
reads.
8. Why is it better to type the statement Me.lblMessage.Text = Hello, world!
rather than just lblMessage.Text = Hello, world!
A: Me means form object
9. Write the statements needed for the Click event procedures of radSum and
radDifference based on the following application. Assume the first label is
named lblMessage and the second is named lblResult.
A: radsum
lblResult.Text = 5 + 3

radDiffernece
lblResult.Text = 5 - 3
10.Explain the error(s) in the following comments:
This is my first program
9/9/12

Display greeting Hi There!


A: There isnt a in front of 9/9/12
11.Determine if each of the following are true or false. If false, explain why.
A) A Visual Basic application consists of a single file.
A: False it consists of many files
B) A Windows application includes at least one form.
A: True
C) The Text property of a form defines what is displayed in the title bar.
A: True
D) The properties of an object can only be set in the Properties window.
A: False you can set it in the code.
E) Text displayed in a label can be changed by the user.
A: True
F) A MenuItem object can have a Click event procedure.
A: True
G) A MenuStrip component can have only one MenuItem object.
A: False it can have many.
H) Each line of program code is called an object
A: False its called a statement
I) Visual Basic is object-oriented programming language.
A: True
J) Program code is typed into the Design window
A: False its typed into the Code window
K) Buttons in the Toolbox are used to switch between the Code and Design
window.
A: False pressing f7 brings you to the code and pressing shift+f7 brings
you to the designer
L) Click is an example of an event.
A: True
M) Private indicates that a procedure can be accessed outside of the Form1
class.
A: False it can only be accessed from the form1 class.
N) Options displayed in an ItelliSense list vary depending on what is typed
before the dot.
A: False it varies on whats typed after the dot.
O) An assignment statement is used to change a value at run time.
A: False it uses the equal sign to give the object property on the left sige
of the equal sign and a value on the right.
P) More than one radio button in a set can be selected at a time.
A: True
Q) The only purpose of a GroupBox object is to display a title for a set of
RadioButton objects.
A: False the GroupBox gives properties to all the RadioButtons
R) Comments affect the way an application runs.
A: False it is for other programmers.
S) Multiline comments are created by placing a question mark (?) at the
beginning of each line.
A: False they are created by placing ()
T) Code Conventions are a set of guidelines for writing an application.
A: True

S-ar putea să vă placă și