0% found this document useful (0 votes)
47 views

Chapter 01

This document provides an introduction to programming in Visual Basic 2010. It discusses basic computer hardware and software concepts. It also covers Visual Basic programming concepts like graphical user interfaces, events, variables, logic and decisions.

Uploaded by

abrahymmstw57
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Chapter 01

This document provides an introduction to programming in Visual Basic 2010. It discusses basic computer hardware and software concepts. It also covers Visual Basic programming concepts like graphical user interfaces, events, variables, logic and decisions.

Uploaded by

abrahymmstw57
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Chapter 1: Introduction to Visual Basic 2010 Programming

MULTIPLE RESPONSE

Modified Multiple Choice

1. A ____ is an input device.


a. scanner c. digital camera
b. keyboard d. printer
ANS: A, B, C PTS: 1 REF: 9

2. An application might allow data to be entered with a ____.


a. scanner c. digital camera
b. mouse d. video camera
ANS: A, B, C, D PTS: 1 REF: 9

3. A ____ is an output device.


a. mouse c. keyboard
b. smartphone screen d. monitor
ANS: B, D PTS: 1 REF: 10

4. A database is a collection of data organized in a manner that allows ____ of that data.
a. scanning c. access
b. retrieval d. use
ANS: B, C, D PTS: 1 REF: 16

5. Buttons for frequently used commands such as ____ are found on the Standard toolbar.
a. Open Project c. Save
b. Cut d. Paste
ANS: A, B, C, D PTS: 1 REF: 18

MULTIPLE CHOICE
1. As shown in the accompanying figure, ____ the physical equipment associated with a computer.
a. computer hardware is c. computer programs are
b. computer software is d. computer cables are
ANS: A PTS: 1 REF: 3

2. Both the program and the data must be placed in the ____ of computers like the laptop shown in the
accompanying figure in order for the computer to carry out the instructions in the program.
a. read only memory (ROM) c. CD-ROM
b. central processing unit (CPU) d. random access memory (RAM)
ANS: D PTS: 1 REF: 4
3. Which item in the accompanying figure is a storage device?
a. 1 c. 3
b. 2 d. 4
ANS: A PTS: 1 REF: 3

4. Which item in the accompanying figure is an input device?


a. 1 c. 3
b. 2 d. 4
ANS: B PTS: 1 REF: 3

5. Which item in the accompanying figure is a processing device?


a. 1 c. 3
b. 2 d. 5
ANS: D PTS: 1 REF: 3

6. In which order do most programs follow these general steps?


a. process data, accept input data, create output data
b. create output data, accept input data, process data
c. accept input data, process data, create output data
d. accept input data, create output data, process data
ANS: C PTS: 1 REF: 4

7. Data is said to be ____ if it remains available after the computer is powered off.
a. persistent c. fragmented
b. volatile d. temporary
ANS: A PTS: 1 REF: 4

8. Most Visual Basic 2010 programs are ____ programs because they communicate with the user through
a graphical user interface (GUI).
a. GUI-based c. event-driven
b. indexed d. persistent
ANS: C PTS: 1 REF: 5

9. As shown in the accompanying figure, a(n) ____ consists of a window containing a variety of objects,
that can be displayed on various devices.
a. ROM c. CPU
b. GUI d. ERD
ANS: B PTS: 1 REF: 5

10. Clicking a button like the one labeled Reset Window in the accompanying figure when a Visual Basic
program is running triggers a(n) ____.
a. index c. baseline
b. radical d. event
ANS: D PTS: 1 REF: 6
11. Users employ GUI objects to ____.
a. select options c. cause events to occur
b. enter data d. all of the above
ANS: D PTS: 1 REF: 6

12. Addition and subtraction are considered to be ____ operations performed by a computer.
a. input c. arithmetic
b. comparing d. output
ANS: C PTS: 1 REF: 10

13. It is the ability of a computer to perform ____ operations that separates it from other types of
calculating devices.
a. arithmetic c. logical
b. input d. output
ANS: C PTS: 1 REF: 11

14. A computer uses ____ operations to compare two values to see if they are equal to each other.
a. arithmetic c. grouping
b. logical d. sorting
ANS: B PTS: 1 REF: 12

15. A computer is able to make decisions based on the results of ____ operations.
a. arithmetic c. logical
b. grouping d. sorting
ANS: C PTS: 1 REF: 16

16. A ____ is a collection of data organized in a manner that allows access, retrieval, and use of that data.
a. file c. program
b. folder d. database
ANS: D PTS: 1 REF: 16

17. The ____ of a programming language is the set of rules that describe how the programming language
elements can be used.
a. logic c. syntax
b. semantics d. GUI
ANS: C PTS: 1 REF: 16

18. A(n) ____ is a set of services and tools that enable a developer to code, test, and implement a computer
program or series of programs.
a. integrated development environment (IDE)
b. graphical user interface (GUI)
c. development studio
d. Microsoft Intermediate Language (MSIL)
ANS: A PTS: 1 REF: 17

19. In the Visual Studio IDE, the ____ identifies the window or application open in the window.
a. title bar c. index bar
b. menu bar d. property
ANS: A PTS: 1 REF: 17

20. The ____ contains a list of commands that allow you to create, edit, save, print, test, and run a Visual
Basic program.
a. menu bar c. Toolbox
b. toolbar d. Properties window
ANS: A PTS: 1 REF: 18

21. The ____ contains the .NET components that you can use to develop the graphical user interface for a
program.
a. menu bar c. Toolbox
b. toolbar d. Properties window
ANS: C PTS: 1 REF: 18

22. The ____ of Visual Studio 2010 contains buttons for commands that are frequently used, such as Open
Project, Save, Cut, Copy, Paste, and Undo.
a. menu bar c. Toolbox
b. Standard toolbar d. Properties window
ANS: B PTS: 1 REF: 18

23. Each control has ____.


a. indices c. IDEs
b. properties d. tools
ANS: B PTS: 1 REF: 19

24. A button or a text box are examples of objects, also called ____, that are part of the graphical user
interface.
a. indices c. libraries
b. classes d. controls
ANS: D PTS: 1 REF: 19

25. A ____ is an item that is a visible part of a graphical user interface.


a. property c. class
b. control d. library
ANS: B PTS: 1 REF: 19

26. ____ are the characteristics of objects in Visual Basic.


a. Methods c. Identifiers
b. Function d. Properties
ANS: D PTS: 1 REF: 19

27. ____ is a language that can be used in Visual Studio.


a. Fortran c. Lisp
b. Visual F# d. COBOL
ANS: B PTS: 1 REF: 19

28. The characteristics of GUI controls such as buttons and text boxes can be set using the ____ window
in the Visual Studio IDE.
a. Characteristics c. Properties
b. Attributes d. Values
ANS: C PTS: 1 REF: 19

29. The most widely used programming language in the world is ____.
a. SQL c. Java
b. XML d. Visual Basic
ANS: D PTS: 1 REF: 19

30. The Visual Studio programming language, ____, is a synthesis of C++ and Visual Basic.
a. Visual J# c. Visual C++
b. Visual C# d. Java
ANS: B PTS: 1 REF: 20

31. The ____ provides tools and processes developers can use to produce and run programs.
a. SQL Server Set c. Java Toolkit
b. .NET Framework d. both A and B
ANS: B PTS: 1 REF: 20

32. All of the following are major features of the .NET Framework 4.0 EXCEPT ____.
a. RAM c. the Common Language Runtime
b. ADO.NET 4.0 d. ASP.NET 4.0
ANS: A PTS: 1 REF: 20

33. A class ____ is a collection of classes that can be made available for developers to use
a. glossary c. index
b. library d. roster
ANS: B PTS: 1 REF: 21

34. The process of ____ is used to create an object from a class.


a. initialization c. objectification
b. instantiation d. classification
ANS: B PTS: 1 REF: 21

35. Each control that you use when developing the graphical user interface is created from a(n) ____ in the
.NET 4.0 Framework.
a. baseline c. index
b. roster d. class
ANS: D PTS: 1 REF: 22

36. A set of prewritten classes called ____ allows you to access data stored in a database.
a. ADO.NET 4.0 c. RAD
b. ASP.NET 4.0 d. CLR
ANS: A PTS: 1 REF: 22

37. The process of using prebuilt classes to make application development faster, easier, and more reliable
is called ____.
a. RAD c. ARD
b. CAD d. CLR
ANS: A PTS: 1 REF: 22

38. The ____ reads the MSIL code and causes the program instructions to be executed
a. CAD c. CLR
b. RAD d. ARD
ANS: C PTS: 1 REF: 23

39. Translating programming language statements into machine-executable instructions is accomplished


by a process called program ____.
a. instantiation c. factoring
b. compilation d. indexing
ANS: B PTS: 1 REF: 23

40. A Web site application runs on a Web server and produces ____ code that is downloaded to a client
computer’s browser.
a. XML c. HTML
b. DHTML d. HTTP
ANS: C PTS: 1 REF: 25

TRUE/FALSE

1. Computer hardware will perform its tasks automatically, regardless of whether a software program is
running or not.

ANS: F PTS: 1 REF: 3

2. Many computer programs perform the following general steps: first accept input, then write output,
and finally process the data, in that order.

ANS: F PTS: 1 REF: 4

3. Both program instructions and the data to be processed must be stored in RAM.

ANS: T PTS: 1 REF: 4

4. In order for the computer to execute a program, or carry out the instructions in the program, only the
data must be placed in the computer’s random access memory (RAM).

ANS: F PTS: 1 REF: 4

5. In order for the computer to execute a program, both the program and the data must be placed in the
computer’s random access memory (RAM).

ANS: T PTS: 1 REF: 4

6. Computer programs can be written in standard English.

ANS: F PTS: 1 REF: 5


7. A graphical user interface (GUI) is a special device for communicating with a user.

ANS: F PTS: 1 REF: 5

8. A programming language is a set of words and symbols that can be interpreted by special computer
software to create instructions that can be executed by a computer.

ANS: T PTS: 1 REF: 5

9. Clicking a button on a program screen causes an event to occur.

ANS: T PTS: 1 REF: 6

10. A computer program can perform addition, subtraction, multiplication, and division operations on
numeric data.

ANS: T PTS: 1 REF: 10

11. Computers can compare numbers, letters of the alphabet, and special characters.

ANS: T PTS: 1 REF: 11

12. A logical operation can be used to determine if two values are equal, if one value is greater than the
other, or if one value is less than the other.

ANS: T PTS: 1 REF: 12

13. If you write a computer program, and want to execute the same program many times without rewriting
it each time, you must save the program on disk.

ANS: T PTS: 1 REF: 16

14. A program can write data, but it cannot save data on disk.

ANS: F PTS: 1 REF: 16

15. Visual Basic 2010 is a programming language.

ANS: T PTS: 1 REF: 16

16. Buttons for the .NET components used to develop the graphical user interface are found on the
Standard toolbar.

ANS: F PTS: 1 REF: 18

17. Visual Studio can be used to write programs only in Visual Basic language.

ANS: F PTS: 1 REF: 19

18. An object acts as a general template and a class is a specific item generated based on the object
template.

ANS: F PTS: 1 REF: 21


19. The .NET Framework 4.0 contains thousands of classes and many class libraries that can be used by
Visual Basic developers.

ANS: T PTS: 1 REF: 22

20. ADO.NET 4.0 allows a program to examine data from a database, but does not permit the program to
update data in a database.

ANS: F PTS: 1 REF: 22

21. ADO.NET 4.0 is not part of the .NET Framework 4.0.

ANS: F PTS: 1 REF: 23

22. Visual Studio 2010 incorporates a new Web designer interface into ASP.NET 4.0 that uses the design
engine of a popular Web page designing program named Adobe Dreamweaver.

ANS: F PTS: 1 REF: 23

23. ADO.NET 4.0 is a programming framework used to build Web applications on a Web server.

ANS: F PTS: 1 REF: 23

24. Almost all of the objects available in the .NET framework, such as buttons, text boxes, and picture
boxes, are available in ASP.NET 4.0.

ANS: T PTS: 1 REF: 23

25. The use of MSIL and CLR offer multiple benefits that provide speed and flexibility for both the
development and execution environments of a program.

ANS: T PTS: 1 REF: 24

MODIFIED TRUE/FALSE

1. The set of instructions that directs a computer to perform tasks is called computer hardware.
_________________________

ANS: F, software

PTS: 1 REF: 2

2. It is the ability of a computer to perform arithmetic operations that separates it from other types of
calculating devices. _________________________

ANS: F, logical

PTS: 1 REF: 11

3. The programming rules of a language are called its semantics. _________________________

ANS: F, syntax
PTS: 1 REF: 17

4. C++ is a language that is derived from the programming language C. _________________________

ANS: T PTS: 1 REF: 19

5. The process of creating an object from a class template is called generation.


_________________________

ANS: F, instantiation

PTS: 1 REF: 21

COMPLETION

1. Program instructions and data must be placed in the computer’s ____________________ to allow the
computer to carry out the program instructions.

ANS:
random access memory
RAM (random access memory)
random access memory (RAM)
RAM

PTS: 1 REF: 4

2. Stored data is said to be ____________________ because it remains available even after the computer
is powered off.

ANS: persistent

PTS: 1 REF: 4

3. Operations, such as addition and subtraction, are called ____________________ operations.

ANS: arithmetic

PTS: 1 REF: 10

4. Operations, such as comparing two numbers to determine if they are equal, are called
____________________ operations.

ANS: logical

PTS: 1 REF: 12

5. A(n) ____________________ is a collection of organized data that can be accessed, retrieved, and
used by a program.

ANS: database

PTS: 1 REF: 16
6. The rules of a programming language are called the ____________________ of the language.

ANS: syntax

PTS: 1 REF: 17

7. Visual Studio 2010 is an example of a set of services and tools called a(n) ____________________
which allows a developer to code, test, and implement programs.

ANS:
integrated development environment
integrated development environment (IDE)
IDE

PTS: 1 REF: 17

8. The ____________________ in Visual Studio 2010 contains the .NET components that can be used in
developing the graphical user interface of a program.

ANS: Toolbox

PTS: 1 REF: 18

9. The ____________________ programming language is a synthesis of Visual Basic and C++.

ANS: Visual C#

PTS: 1 REF: 20

10. When an object has been created from a class, we say that a(n) _______________ of the class has been
created.

ANS: instance

PTS: 1 REF: 21

11. The process of creating an object from a class is called ____________________.

ANS: instantiation

PTS: 1 REF: 21

12. An object is instantiated from a(n) ____________________.

ANS: class

PTS: 1 REF: 21

13. A class acts as a general template from which a(n) ____________________ can be created.

ANS: object

PTS: 1 REF: 21
14. The .NET Framework 4.0 ____________________ contains thousands of classes.

ANS: class library

PTS: 1 REF: 22

15. ____________________ is the set of prewritten classes in the .NET Framework 4.0 used in Visual
Studio to work with databases.

ANS: ADO.NET 4.0

PTS: 1 REF: 22

16. ____________________ is the set of prewritten classes in the .NET Framework 4.0 that is used in
Visual Studio 2010 to produce Web applications.

ANS: ASP.NET 4.0

PTS: 1 REF: 23

17. When a program written in a Visual Studio 2010 programming language is compiled, the code is
translated into an intermediate language called the ____________________.

ANS:
Microsoft Intermediate Language
Microsoft Intermediate Language (MSIL)
MSIL
MSIL (Microsoft Intermediate Language)

PTS: 1 REF: 23

18. The ____________________ reads the MSIL code and causes the program instructions to be executed.

ANS:
Common Language Runtime (CLR)
Common Language Runtime
CLR (Common Language Runtime)
CLR

PTS: 1 REF: 23

19. An application that runs on a Pocket PC or smartphone is called a(n) ____________________


application.

ANS: mobile

PTS: 1 REF: 25

20. An application that runs on a computer device using the Windows graphical user interface is called
a(n) ____________________ application.

ANS: Windows

PTS: 1 REF: 25
MATCHING

Identify the letter of the choice that best matches the phrase or definition.
a. hardware f. ADO.NET 4.0
b. event-driven g. syntax
c. class library h. persistent
d. logical i. .NET Framework 4.0
e. RAM j. Visual Basic
1. Where data must be placed in order to be processed
2. The physical equipment associated with a computer
3. Kind of data that remains available even after the computer is powered off
4. The kind of computer program that communicates interactively with the user through a graphical user
interface
5. The kind of operations used to compare two values
6. The programming rules of a language
7. The most widely used programming language in the world
8. Available for all developers who need to use it
9. The use of these classes allows a program to be developed rapidly
10. Provides the tools for a program to examine data that was retrieved from a database

1. ANS: E PTS: 1 REF: 4


2. ANS: A PTS: 1 REF: 3
3. ANS: H PTS: 1 REF: 4
4. ANS: B PTS: 1 REF: 5
5. ANS: D PTS: 1 REF: 12
6. ANS: G PTS: 1 REF: 17
7. ANS: J PTS: 1 REF: 19
8. ANS: C PTS: 1 REF: 21
9. ANS: I PTS: 1 REF: 22
10. ANS: F PTS: 1 REF: 22

ESSAY

1. Define data, explain its three forms, and the general steps a computer performs related to data.

ANS:
Data includes words, numbers, videos, graphics, and sound that programs manipulate, display, and
otherwise process. The basic function of many programs is to accept some form of data (sometimes
called input data), manipulate the data in some manner (sometimes called processing), and create some
form of data usable by people or other computers (sometimes called output data, or information). In
short, many computer programs perform the following general steps: accept input data, process the
data, and create output data. The data that acts as input to a program, the processing that occurs, and
the output that is created varies with the requirements of the program.

PTS: 1 REF: 3-4 TOP: Critical Thinking

2. Define syntax and explain its significance.

ANS:
Each program statement causes the computer to perform one or more operations. When written, these
instructions must conform to the rules of the Visual Basic 2010 language. Coding a program is a
precise skill. The developer must follow the syntax, or programming rules, of the programming
language precisely. Even a single coding error can cause a program to execute improperly. Therefore,
the developer must pay strict attention to coding an error-free program.

PTS: 1 REF: 16-17 TOP: Critical Thinking

3. Discuss at least four of the elements found in the Visual Studio 2010 window.

ANS:
The title bar identifies the window and the application open in the window.

The menu bar displays the Visual Studio 2010 menu names, each representing a list of commands that
allow you to create, edit, save, print, test, and run a Visual Basic program, as well as perform other
functions that are critical to the development of Visual Basic programs.

The Standard toolbar contains buttons that execute frequently used commands such as Open Project,
Save, Cut, Copy, Paste, and Undo.

The Toolbox contains .NET components that you can use to develop the graphical user interface for
the program.

The main work area is used to contain the item on which you are working.

The Solution Explorer window displays the elements of the Visual Basic solution, which is the name
given to the Visual Basic program and other items that are generated by Visual Studio so the program
will execute properly.

An item that is a visible part of a graphical user interface, is called an object, or control. Each object in
a Visual Basic program has a set of characteristics called the properties of the object. These properties
can be set in the Properties window within Visual Studio.

PTS: 1 REF: 17-19 TOP: Critical Thinking

CASE

Critical Thinking Questions


Case 1-1

As you prepare to bring one of the interns in your software development company up to speed on the
project on which you are working, you decide to create some illustrations of your programming to
make certain key concepts clear to the intern.

1. Which of the following is an example of an event that a user might perform in the application you are
creating?

a. powering on the computer c. clicking a button


b. saving data to RAM d. all of the above

ANS:
c
PTS: 1 REF: 6

2. All of the following are examples of actions within event-driven programs EXCEPT ____.

a. An account balance is shown when a c. The computer reboots spontaneously as the


button is clicked. result of a head crash.
b. A message appears on the screen in d. A text box is reset when a Reset button is
response to text entered by the user. clicked.

ANS:
c

PTS: 1 REF: 9

Critical Thinking Questions


Case 1-2

Visual Studio is new to you and you are trying to determine which of its languages is the best match
for a couple of the projects on which you and your team are about to embark.

3. You are looking for a program that will be the most user-friendly for two of the junior members of
your team, both of whom are new to programming. Which of the following is the best match?

a. Visual Basic c. Visual C#


b. C++ d. All of the above

ANS:
a

PTS: 1 REF: 19

4. Steve and Shana on your team are looking for a language that will allow them to create an application
that requires a high degree of control; they are not intimidated by complexity, as they have been
programming for several years. Which of the following is the best match for them?

a. Visual Basic c. C++


b. Visual C# d. Visual F#

ANS:
c

PTS: 1 REF: 20

You might also like