Chapter 1: Introduction to Visual Basic 2012 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 power is turned off.
a.	persistent	c.	fragmented	
b.	volatile	d.	temporary	

ANS:	A	PTS:	1	REF:	4

	8.	Most Visual Basic 2012 programs are ____ programs that 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:	6

	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:	6

	10.	Tapping or 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 usage rules for that language.
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:	18

	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 2012 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.	One of the most widely used programming languages in the world is ____.
a.	Pascal	c.	Fortran	
b.	BASIC	d.	Visual Basic	

ANS:	D	PTS:	1	REF:	20

	30.	All of the following are Visual Studio Express 2012 products EXCEPT ____.
a.	Express for Web	c.	Express for Windows 8	
b.	Express for iPhone	d.	Team Foundation Server Express	

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:	21

	32.	All of the following are major features of the .NET Framework 4.5 EXCEPT ____.
a.	RAM	c.	the Common Language Runtime	
b.	ADO.NET 4.5	d.	ASP.NET 4.5	

ANS:	A	PTS:	1	REF:	21

	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:	22

	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:	23

	35.	Each control that you use when developing the graphical user interface is created from a(n) ____ in the .NET 4.5 Framework.
a.	baseline	c.	index	
b.	roster	d.	class	

ANS:	D	PTS:	1	REF:	23

	36.	A set of prewritten classes called ____ allows you to access data stored in a database.
a.	ADO.NET 4.5	c.	RAD	
b.	ASP.NET 4.5	d.	CLR	

ANS:	A	PTS:	1	REF:	23

	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:	23

	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:	25

	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:	25

	40.	A Web application runs on a web server and produces ____ code that is downloaded to a client computer.
a.	XML	c.	HTML5	
b.	SQL	d.	HTTP	

ANS:	C	PTS:	1	REF:	27

TRUE/FALSE

	1.	A computer program on a mobile device or Windows 8 computer is also called an app.

ANS:	T	PTS:	1	REF:	2

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

ANS:	F	PTS:	1	REF:	3

	3.	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:	3-4

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

ANS:	T	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 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

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

ANS:	F	PTS:	1	REF:	6

	9.	Tapping or 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 2012 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.	The Solution Explorer contains the item you are currently developing.

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:	23

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

ANS:	T	PTS:	1	REF:	23

	20.	ADO.NET 4.5 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:	23

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

ANS:	F	PTS:	1	REF:	24

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

ANS:	T	PTS:	1	REF:	24

	23.	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:	25

	24.	After the compiling process is complete and a program is ready for execution, the MSIL reads the CLR in RAM in a form that allows the computer’s CPU to execute the instructions in the program.

ANS:	F	PTS:	1	REF:	25

	25.	Utmost among the benefits offered by MSIL and CLR is that a program written using Visual Studio 2012 and compiled into MSIL can be executed on any computer using any operating system, as long as .NET Framework 4.5 is available on the computer.

ANS:	T	PTS:	1	REF:	25

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:	16-17

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

ANS:	T			PTS:	1	REF:	20

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

ANS:	F, instantiation

PTS:	1	REF:	23

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 power is turned off.

ANS:	persistent

PTS:	1	REF:	4

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

ANS:	arithmetic

PTS:	1	REF:	10

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

ANS:	database

PTS:	1	REF:	16

	5.	The usage rules of a programming language are called the ____________________ of the language.

ANS:	syntax

PTS:	1	REF:	16

	6.	Visual Studio 2012 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

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

ANS:	Toolbox

PTS:	1	REF:	18

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

ANS:	Visual C#

PTS:	1	REF:	21

	9.	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:	23

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

ANS:	instantiation

PTS:	1	REF:	23

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

ANS:	class

PTS:	1	REF:	23

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

ANS:	object

PTS:	1	REF:	23

	13.	The .NET Framework 4.5 ____________________ contains thousands of classes.

ANS:	class library

PTS:	1	REF:	23

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

ANS:	ADO.NET 4.5

PTS:	1	REF:	23

	15.	Once changes have been made to data, ____________________ enables a program to update the database with the new information by writing the data into the database.

ANS:	ASP.NET 4.5

PTS:	1	REF:	24

	16.	When a program written in a Visual Studio 2012 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:	25

	17.	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:	25

	18.	A(n) ____________________ application means the program will run on a computer or other device that supports the Windows GUI.

ANS:	Windows

PTS:	1	REF:	27

	19.	You can create ____________________ apps that are designed to run on Windows 8 computers and mobile devices, such as smartphones and tablets.

ANS:	Windows Store

PTS:	1	REF:	27

	20.	A(n) ____________________ application includes writing Visual Basic 2012 code to automate and manipulate documents created using Microsoft Office 2010 and Office 2013.

ANS:	Office

PTS:	1	REF:	27

MATCHING

Identify the letter of the choice that best matches the phrase or definition.
a.	hardware	f.	ADO.NET 4.5	
b.	event-driven	g.	syntax	
c.	class library	h.	persistent	
d.	logical	i.	.NET Framework 4.5	
e.	RAM	j.	F#	

	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 usage rules of a programming language

	7.	A multipurpose language similar to Visual Basic and C#

	8.	Available for all developers who need to use it

	9.	Provides tools and processes developers can use to process and run programs

	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:	6

	5.	ANS:	D	PTS:	1	REF:	11-12

	6.	ANS:	G	PTS:	1	REF:	16

	7.	ANS:	J	PTS:	1	REF:	21

	8.	ANS:	C	PTS:	1	REF:	22

	9.	ANS:	I	PTS:	1	REF:	21

	10.	ANS:	F	PTS:	1	REF:	23

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 2012 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 2012 window.

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

The menu bar displays the Visual Studio 2012 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:	18-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	TOP:	Critical Thinking	

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

a. An account balance is shown when a button is clicked.	c. The computer reboots spontaneously as the result of a head crash.	
b. A message appears on the screen in response to text entered by the user.	d. A text box is reset when a Reset button is clicked.	

ANS:	
C

PTS:	1	REF:	9	TOP:	Critical Thinking	

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:	20	TOP:	Critical Thinking	

	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	TOP:	Critical Thinking