Question: When you append the letter m or n to a numeric literal it is referred to as a __________.

Answer Choices:
monetary literal
decimal
double
mnemonic literal

Answer: decimal

 

Question: A(n) __________ variable belongs to the method in which it is declared, and only statements inside that method can access the variable.

Answer Choices:
limited
local
global
static

Answer: local

 

Question: Which one of the following statements declares the string variables city, state, and zip using a single declaration statement?

Answer Choices:
string city, state, zip;
string city; string state; string zip;
string city_state_zip;
string city state zip;

Answer: string city, state, zip;

 

Question: The binary number 11000011 represents the decimal number:

Answer Choices:
189
187
197
199

Answer: 195

 

Question: The advantage(s) of using two different addresses on a computer (MAC address and IP address) include:

Answer: All of the above

 

Question: The binary representation of the decimal number 231 is:

Answer Choices:
11100011
11100111
11100001
11100001

Answer: 11100111

 

Question: A(n) __________ identifies a variable in the program code.

Answer Choices:
variable name
identifying bit
hash tag

Answer: variable name

 

Question: The purpose of a variable declaration statement is to tell the compiler that you plan to use a variable of a specified name to store a particular type of data in the program.

Answer Choices:
True
False

Answer: True

 

Question: A variable of the __________ data type can hold any string of characters, such as a person’s name, address, password, and so on.

Answer Choices:
<font face=”Courier New”>double</font>
<font face=”Courier New”>int</font>
<font face=”Courier New”>string</font>
<font face=”Courier New”>decimal</font>

Answer: <font face=”Courier New”>string</font>

 

Question: Only strings are compatible with the string data type.

Answer Choices:
True
False

Answer: False

 

Question: You cannot declare two variables with the same _______ in the same scope.

Answer Choices:
lifetime
name
value
data type

Answer: name

 

Question: Any data that the user enters into a TextBox control is stored in the control’s Text property as a string, even if it is a number.

Answer Choices:
True
False

Answer: True

 

Question: The Parse methods work even if the string that is being converted contains an invalid numeric value.

Answer Choices:
True
False

Answer: False

 

Question: In C#, you must declare a variable in a program before you can use it to store data.

Answer Choices:
True
False

Answer: True

 

Question: Once you have assigned a value to a variable, you can use the variable in other operations.

Answer Choices:
True
False

Answer: True

 

Question: Code that responds to exceptions when they are thrown and prevents the program from abruptly crashing is called an _______.

Answer Choices:
critical state handler
debugger
exception handler
catch-all

Answer: exception handler

 

Question: Which one of the following is the general format for a variable declaration statement?

Answer Choices:
<font face=”Courier New”><i>VariableName DataType;</i></font>
<font face=”Courier New”><i>DataType VariableName;</i></font>
<font face=”Courier New”><i>DataName VariableType;</i></font>
<font face=”Courier New”><i>NameType VariableData;</i></font>

Answer: <font face=”Courier New”><i>DataType VariableName;</i></font>

 

Question: In C#, the + operator has two uses: string concatenation and numeric addition.

Answer Choices:
True
False

Answer: True

 

Question: Which one of the following statements initializes the color variable with the string “red”?

Answer Choices:
<font face=”Courier New”>color = “”red””;</font>
<font face=”Courier New”>string color = “red”</font>
<font face=”Courier New”>color = “red”</font>
<font face=”Courier New”>string color = “red”</font>

Answer: <font face=”Courier New”>string color = “red”</font>

 

Question: The C# language provides the _______ data type that you can use to create variables that hold true or false values.

Answer Choices:
bool
int
decimal
double

Answer: bool