Вы находитесь на странице: 1из 11

Checkpoint

1.1 List the five major hardware components of a computer system.


 The central processing unit (CPU)
 Main memory
 Secondary storage devices
 Input devices
 Output devices
1.2 What is main memory? What is its purpose?
 The main storage region of a computer, to which the central processor has immediate or
direct access.
 Hold instructions and data when a program executing, while auxiliary memory holds data
and programs not currently in use and provides long term storage.
1.3 Explain why computers have both main memory and secondary storage.
 Computers have main memory because RAM, main memory, is is short term storage. While
secondary storage is long term storage so that information can be saved longer.
1.4 What are the two general categories of software?
 System software.
 Application software.

Checkpoint

1.5 What is an algorithm?


 is a set of instructions designed to perform a specific task. This can be a simple process, such
as multiplying two numbers, or a complex operation, such as playing a compressed video
file.
1.6 Why were computer programming languages invented?
 because writing code using switches is far too difficult. This kind of logic is simple enough
that it could be coded by a human directly in machine language, with punchcards or
whatever.

1.7 What are the two methods of programming used today?

1.8 What does event-driven mean?

 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.

1.9 Describe the difference between a property and a method.

 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

1.13 Is txtFirst+LastName an acceptable control name? Why or why not?

 No; the + symbol is an illegal character for control names.

Checkpoint

1.14 What four items should be identified when defining what a program is to do?

 Ultimate Objective of the program (Final Output)


 Input limitations
 Programming Language and its limitations
 Test Cases

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.

1.17 What is a flowchart?

 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.18 What is pseudocode?

 pseudocode is a plain language description of the steps in an algorithm or another system.


Pseudocode often uses structural conventions of a normal programming language, but is
intended for human reading rather than machine reading.

1.19 What is a runtime error?


 is a program error that occurs while the program is running.

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

1.21 How much testing should you perform on a new program?

 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

1.22 Briefly describe the purpose of the Solution Explorer window.

 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.

1.23 Briefly describe the purpose of the Properties window.

 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.

1.24 Briefly describe the purpose of the Dynamic Help window.

 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.

1.25 Briefly describe the purpose of the standard toolbar.

 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.

Review Questions and Exercises

Fill-in-the-Blank

1. The job of the CPU is to fetch instructions, carry out the

operations commanded by the instructions, and produce some outcome or resultant information.

2. A(n) Disk Drive is an example of a secondary storage device.

3. The two general categories of software are System Software and

Utility Software.

4. A program is a set of Instructions.

5. Since computers can’t be programmed in natural human language, algorithms must

be written in a(n) Machine Language language.

6. Machine Language is the only language computers really process.

7. Words that have special meaning in a programming language are called

Keywords.

8. Words or names defined by the programmer are called Programmer defined identifiers.

9. Operators are characters or symbols that perform operations on

one or more operands.

10. A(n) Remark or Comment is part of an application’s code but is ignored by

the compiler. It is intended for documentation purposes only.

11. The rules that must be followed when constructing a program are called

Syntax.

12. Input is information a program gathers from the outside


world.

13. Output is information a program sends to the outside world.

14. A(n) Algorithm is a set of well-defined steps for performing a task

or solving a problem.

15. A(n) Flowchart is a diagram that graphically illustrates the flow

of a program.

16. Pseudocode is a cross between human language and a programming language.

17. To set the Visual Basic environment options, click the Options . . . command, which

is found on the Window menu.

18. If you do not see the Solution Explorer or Properties windows in Visual Studio, you

may use the View menu menu to bring them up.

19. A(n) Solution is a container for holding a project.

20. A(n) Project is a group of files that make up a software application.

21. The Solution Explore Window window allows you to navigate among the files in

your project.

22. The Properties window shows most of the currently selected

object’s properties and those properties’ values.

23. When windows are Docked, it means they are attached to each

other or to one of the edges of the Visual Studio main window.

24. To dock a floating window, Dock its title bar or drag it to

one of the edges of the main window.

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.

27. The Designer window contains your application’s form. This is

where you design your application’s user interface by placing controls on the form

that appears when your application executes.

28. You use the Toolbox to place controls on an application’s form.


It contains buttons for the commonly used Visual Basic controls.

29. The Help window displays help topics that are relevant to

the operation you are currently performing in Visual Basic.

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

1. What is the difference between main memory and secondary storage?


 Primary memory is the main memory (Hard disk, RAM) where the operating system resides.
Secondary memory can be external devices like CD, floppy magnetic discs etc. secondary storage
cannot be directly accessed by the CPU and is also external memory storage.
2. What is the difference between operating system software and application software?
 The main difference between operating system and application software is that an operating
system is a system software that works as the interface between the user and the hardware
while the application software is a program that performs a specific task. ... This software assists
the tasks of the system.
3. Briefly describe what procedural programming means.
 Procedural Programming can be defined as a programming model which is derived from
structured programming, based upon the concept of calling procedure. Procedures, also known
as routines, subroutines or functions, simply consist of a series of computational steps to be
carried out.
4. Briefly describe what object-oriented programming means.
 Object-oriented programming (OOP) is a programming paradigm based on the concept of
"objects", which can contain data and code: data in the form of fields (often known as attributes
or properties), and code, in the form of procedures (often known as methods).Briefly describe
what an event-driven program is.
 is when a program is designed to respond to user engagement in various forms. It is known as a
programming paradigm in which the flow of program execution is determined by “events.”
Events are any user interaction, such as a click or key press, in response to prompt from the
system.

6. Why has the advent of graphical user interfaces (GUIs) influenced the shift from

procedural programming to object-oriented/event-driven programming?

 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?

 A form is a window, onto which other controls may be placed.

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.

11. What is a keyword?

 Words that have a special meaning in a programming language. Keywords may only be used for
their intended purpose

12. What is the purpose of inserting comments in a program?

 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.

13. What is language syntax?

 Rules that must be followed when constructing a method. Syntax dictates how keywords,
operators, and programmer-defined names may be used.

14. What is a syntax error?

 A syntax error is the incorrect use of a programming language element, such as a keyword,
operator, or programmer-defined name.

15. What is a runtime error?

 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.

16. What is an operator?

 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.

18. What is pseudocode?

 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?

 The Text property

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.

22. What is the Toolbox window in Visual Studio?

 The Toolbox window contains buttons and icons that let you build rich visual interfaces in
Windows desktop applications.

23. What is the standard toolbar in Visual Studio?

 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.

24. What is a tooltip?

 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

are indicated in the figure?

What Do You Think?

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.

b. 2001sales is illegal because it starts with a number.

c. lblUser Age is illegal because it has a space.

d. txtName/Address is illegal because it contains the / character.

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

b. A Button control that, when clicked, calculates an annual interest rate

c. A Label control used to display the total of an order

d. A Button control that clears all the input fields on a form

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:

a. txtPriceEach is a text box for entering an item's price.

b. txtQuantity is a text box for entering the quantity of an item being purchased.

c. txtTaxRate is a text box for entering the tax rate.

d. btnCalcSale is a button that calculates the total of a sale when clicked with the
mouse.

e. lblSubTotal is a label that displays a sale's subtotal.

f. lblTotal is a label that displays a sale's total.

Вам также может понравиться