Академический Документы
Профессиональный Документы
Культура Документы
Checkpoint
is a programming paradigm in which the flow of the program is determined by events such
as user actions (mouse clicks, key presses), sensor outputs, or messages from other
programs or threads.
Properties are basically information that an object has. Methods are what an object can do.
1.10 Why should the programmer change the name of a control from its default
name?
The default name is not descriptive; it does not indicate the purpose of the control.
1.11 If a control has the programmer-defined name txtRadius, what type of control
is it?
A text box
1.12 What is the default name given to the first TextBox control created in an
application?
TextBox1
Checkpoint
1.14 What four items should be identified when defining what a program is to do?
1.15 Describe the importance of good planning in the process of creating a Visual
Basic application.
Planning helps the programmer create a good design and avoid errors that may not otherwise
be anticipated.
1.16 What does it mean to visualize a program running? What is the value of such an
activity?
It means to imagine what the computer screen looks like while the program is running. By doing
this we can address a users concerns by putting yourself in their shoes.
A flowchart is a diagram that depicts a process, system or computer algorithm. They are widely
used in multiple fields to document, study, plan, improve and communicate often complex
processes in clear, easy-to-understand diagrams.
1.20 What is the purpose of testing a program with sample data or input?
Test data is used for both positive testing to verify that functions produce expected results for
given inputs and for negative testing to test software ability to handle unusual, exceptional or
unexpected inputs
There is no written rule. According to BCS/ISTQB Software Testing Foundation, you cannot
physically test for every scenario. When deciding how much testing you should carry out, you
may want to consider the level of risk involved, including technical and business risk and
even budget or time constraints.
Checkpoint
Solution Explorer is a special window that enables you to manage solutions, projects, and files. It
provides a complete view of the files in a project, and it enables you to add or remove files and
to organize files into subfolders.
The Properties window is used to display properties for objects selected in the two main types
of windows available in the Visual Studio integrated development environment (IDE). These two
types of windows are: Tool windows such as Solution Explorer, Class View, and Object browser.
The Dynamic Help command opens the Dynamic Help window, which is populated with topics
that apply to the current operation. The Index command opens the Index window, in which you
can enter a topic and get help on the specific topic.
The Standard Toolbar gives the user access to file operations, printing, movement of data
blocks, the undo system, and to some of the powerful tools like the function creator and the
graphing system
1.26hat is Design mode? What is Run mode? What is Break mode?
The 'Design Mode' is a tool available in Developer tab that helps to toggle to design mode. The
design mode tab is useful only with excel containing macros or Visual basic controls.
Run mode occurs when a procedure is running. To run (or execute) a procedure, just place the
cursor anywhere within the procedure code and hit the F5 key (or select Run from the Run
menu). If a running procedure seems to be hanging, you can usually stop the procedure by
hitting Ctrl-Break (hold down the Control key and hit the Break key).
Break mode is entered when a running procedure stops because of either an error in the code
or a deliberate act on your part (described later in this chapter).1.27 What is the difference
between the toolbar and the Toolbox?
1.27What is a ToolTip?
The tooltip, infotip, or hint is a common graphical user interface element displayed as an
informational text box when hovering over an item. It is used in conjunction with a cursor,
usually a pointer.
1.28What is the difference between the toolbar and the Toolbox?
is that toolbar is (graphical user interface) a row of buttons, usually marked with icons, used to
activate the functions of an application or operating system while toolbox is a storage case for
tools.
Fill-in-the-Blank
operations commanded by the instructions, and produce some outcome or resultant information.
Utility Software.
Keywords.
8. Words or names defined by the programmer are called Programmer defined identifiers.
11. The rules that must be followed when constructing a program are called
Syntax.
or solving a problem.
of a program.
17. To set the Visual Basic environment options, click the Options . . . command, which
18. If you do not see the Solution Explorer or Properties windows in Visual Studio, you
21. The Solution Explore Window window allows you to navigate among the files in
your project.
23. When windows are Docked, it means they are attached to each
25. Visual Studio’s Tittle bar window indicates the name of the project you are working on while you are
in Design mode.
26. All commands executed by the Standard toolbar may also be executed
from a menu.
where you design your application’s user interface by placing controls on the form
29. The Help window displays help topics that are relevant to
30. A(n) Tooltip is a small box that is displayed when you hold the
mouse cursor over a button on the toolbar or in the Toolbox for a few seconds.
Short Answer
6. Why has the advent of graphical user interfaces (GUIs) influenced the shift from
Simply because, GUIs can be of any level of complexity. Elements such as buttons, links, etc all
need to properly reference to different objects. If you click here, go there, if you click down
there, go here, etc. It is like a very big, complex web. You can imagine that procedural code
would make it very difficult to do anything that can grant the user the ability to press whatever
they want whenever they want. That's why object oriented code is much more preferable.
7. From what you have read in this chapter, describe the difference between a Label
control and a TextBox control. When is it appropriate to use one or the other?
It is appropriate to use a Label control when displaying data that the user cannot change. It is
appropriate to use a TextBox control when the user must enter data.
8. When creating a VB application, you will spend much of your time doing what
three things?
creating the GUI elements that make up the application's user interface, setting the properties
of the GUI elements, and writing programming language statements that respond to events and
perform other operations.
9. What is a form?
10. Summarize the mandatory rules that you must follow when naming a control.
Control names must start with a letter. The remaining characters may be letters, digits, or
underscore characters only. You cannot use spaces, special symbols, or punctuation characters
in a control name.
Words that have a special meaning in a programming language. Keywords may only be used for
their intended purpose
Comments, or remarks, are notes that explain the purpose of statements or sections of code;
they are ignored by the compiler.
They are intended for the programmer or others who might read the application's code.
Rules that must be followed when constructing a method. Syntax dictates how keywords,
operators, and programmer-defined names may be used.
A syntax error is the incorrect use of a programming language element, such as a keyword,
operator, or programmer-defined name.
A runtime error is an error that occurs while running the program. Runtime errors do not
prevent an application from executing but cause it to produce incorrect results.
Operators perform operations on one or more operands. An operand is usually a piece of data,
such as a number. Examples of operators include +, -, *, and / .
17. What is a flowchart?
A flowchart is a diagram that graphically depicts the flow of a method. It uses boxes and other
symbols to represent each step.
Pseudocode is a cross between human language and a programming language. Although the
computer can't understand pseudocode, programmers often find it helpful to plan an algorithm
in a language that's almost a programming language but still very readable by humans.
19. What default name will VB give to the first Label control that you place on a form?
What default name will VB assign to the first TextBox control that you place on a
form?
VB will assign the default name Label1 to the first Label control and TextBox1 to the first
TextBox control
20. What property determines the text that is displayed by a Label control?
21. What is Auto Hide? How do you turn Auto Hide on or off?
When Auto Hide is turned on, a window is displayed only as a tab along one of the edges of the
Visual Studio window. This feature gives you more room to view your application's forms and
code. oo To set a window to Auto Hide, right-click its caption bar and select Auto Hide.
o To remove the Auto Hide feature from a window, click its tab to display it; then right-click
its caption bar and deselect Auto Hide.
o Alternatively, you can click the little pushpin icon on the window's caption bar to turn Auto
Hide on and off.
The Toolbox window contains buttons and icons that let you build rich visual interfaces in
Windows desktop applications.
The standard toolbar contains buttons that execute frequently used commands. All commands
executed by the toolbar may also be executed from a menu, but the standard toolbar gives you
quicker access to them.
A ToolTip is a small rectangular box that pops up when you hover the mouse over a button on
the toolbar or in the Toolbox window for a few seconds. The pop up message contains a short
description of the button's purpose.
25. If you do not see the Solution Explorer window in Visual Studio, how do you display it?
If you do not see the Solution Explorer window, click VIEW on the menu bar, and select Solution
Explorer from the list. You can also press Ctrl + Alt + L on the keyboard.
26. If you do not see the Properties window in Visual Studio, how do you display it?
If you do not see the Properties window, click VIEW on the menu bar, and select Properties from
the list. You can also press F4 on the keyboard.
27. How do you display the Dynamic Help window in Visual Studio?
28. What mode is Visual Basic in while you are designing and building an application?
29. What mode is Visual Basic in while you are running an application?
30. What mode is Visual Basic in while an application is suspended for debugging?
31. Figure 1-29 shows the Visual Basic IDE. What are the names of the four areas that
1. Are each of the following control names legal or illegal? If a name is illegal, indicate why.
a. txtUserName
b. 2001sales
c. lblUser Age
d. txtName/Address
e. btnCalcSubtotal
Answer:
a. txtUserName is legal.
e. btnCalcSubtotal is legal.
2. What type of control does each of the following prefixes usually indicate?
a. btn
b. lbl
c. txt
Answer:
a. a button
b. a label
c. a text box
3. For each of the following controls, make up a legal name that conforms to the standard control name
convention described in this chapter.
a. A TextBox control in which the user enters his or her last name
Answer:
a. lblLastName
b. btnCalcInterestRate
c. lblOrderTotal
d. btnClear
4. The following control names appear in a Visual Basic application used in a retail
store. Indicate what type of control each is and guess its purpose.
a. txtPriceEach
b. txtQuantity
c. txtTaxRate
d. btnCalcSale
e. lblSubTotal
f. lblTotal
Answer:
b. txtQuantity is a text box for entering the quantity of an item being purchased.
d. btnCalcSale is a button that calculates the total of a sale when clicked with the
mouse.