Chapter 6 You can format a number using the syntax

subject Type Homework Help
subject Pages 4
subject Words 676
subject Authors Diane Zak

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
Chapter 6: Where Can I Store This? (Variables and Constants)
TRUE/FALSE
1. Each memory location inside a computer can hold only one item of data at a time.
2. An item stored in a memory location can be a number, text or a Boolean value.
3. You reserve a memory location using a Visual Basic instruction that assigns both a name and data type
to the memory location.
4. Because control names typically are more concise than variable names, using control names in an
expression makes the expression much shorter and easier to understand.
5. You use a problem’s solution—in other words, its output, processing, and input information and its
algorithmto determine the variables to use when coding an application.
6. It is customary to enter the variable declaration statements at the end of the procedure.
7. Every numeric data type in Visual Basic has a TryText method that can be used to convert text to that
numeric data type.
8. The TryParse method parses the text, which means it looks at each character in the text, to determine
whether the text can be converted to a number of the specified data type.
9. A procedure-level variable has the same lifetime as the procedure in which it is declared.
10. The desk-check table for a program will contain two columns for each variable.
11. In addition to reserving (or declaring) variables in a program, you also can declare named constants.
page-pf2
12. The value in a named constant can change during run time.
13. When a named constant’s value needs to be changed, the programmer must change its value in its
declaration statement.
14. The formatString argument in the ToString method must take the form “xAA”, where AA is the format
specifier and x is the precision specifier.
15. When formatting characters, you can use either an uppercase letter or a lowercase letter as the format
specifier.
MULTIPLE CHOICE
1. The ____ memory of a computer is composed of memory locations.
a.
external
c.
internal
b.
hidden
d.
special
2. A ____ is a value that can be True or False.
a.
Truth
c.
Dim
b.
Boolean value
d.
Scope
3. When you start an application, each program instruction is placed in a ____, where it awaits
processing.
a.
hard core
c.
register
b.
memory location
d.
processor
4. Memory locations are called ____ because their contents can change (vary) as the program is running.
a.
variables
c.
constants
b.
invariables
d.
parameters
5. To declare a variable in an event procedure, where most variables are declared, you use the Visual
Basic ____ statement.
a.
Sub
c.
Create
b.
New
d.
Dim
6. The basic syntax of the TryParse method is ____.
page-pf3
a.
TryParse(text, numericVariableName) dataType
b.
TryParse(text, numericVariableName)
c.
dataType.TryParse(text, numericVariableName)
d.
dataType TryParse text, numericVariableName
7. A procedure-level variable has ____ scope.
a.
program
c.
variable
b.
procedure
d.
Boolean
8. ____ refers to the area where a variable is recognized in an application’s code.
a.
Scope
c.
Blocking
b.
Field of view
d.
Object control
9. Programmers refer to the length of time a variable remains in memory as its ____.
a.
size
c.
usefulness
b.
depth
d.
lifetime
10. A ____ is a memory location whose value cannot change while the application is running.
a.
named constant
c.
predefined variable
b.
variable
d.
touched variable
11. You create a named constant using the ____ statement.
a.
NamedC
c.
NConst
b.
Const
d.
NoAlter
12. Specifying the number of decimal places and the special characters to display in a number is called
____.
a.
describing
c.
formatting
b.
controlling
d.
highlighting
13. A ____ is text that is enclosed in double quotation marks.
a.
word
c.
word array
b.
character list
d.
string
14. You can format a number using the syntax ____.
a.
numericVariableName.ToString(formatString)
b.
formatString.ToString(numericVariableName)
c.
ToString.numericVariableName(formatString)
d.
numericVariableName.formatString(ToString)
page-pf4
15. The format specifier ____ does not include a dollar sign, and negative values are preceded by a minus
sign.
a.
C or c
c.
F or f
b.
N or n
d.
P or p

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.