Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Review Questions

1. When the user types into a Textbox control, the text is stored in the control’s __________ property.

a. Input

b. Text

c. String

d. Data

2. A __________ is a storage location in memory that is represented by a name

. a. mnemonic

b. data type

c. namespace

d. variable

3. In C#, you must __________ a variable before you can use it to store data.

a. cite

b. associate

c. declare

d. instance

4. A variable’s __________ indicates the type of data that the variable will hold

. a. name

b. data type

c. scope

d. value

5. Fundamental types of data, such as strings, integers, and real numbers, are known as __________.

a. primitive data types

b. fundamental variables

c. logical digits

d. literal data types

6. A __________ identifies a variable in the program code.

a. binary number

b. variable name
c. unique global identifier

d. hexadecimal value

7. A common operation performed on strings is __________, or appending one string to the end of
another string.

a. addition

b. merging

c. concatenation

d. tying

8. A __________ belongs to the method in which it is declared, and only statements inside that method
can access the variable.

a. method variable

b. primitive variable

c. temporary variable

d. local variable

9. Programmers use the term __________ to describe the part of a program in which a variable may be
accessed.

a. range

b. scope

c. focus

d. field

10. A variable’s __________ is the time period during which the variable exists in memory while the
program is executing.

a. lifetime

b. run time

c. time to live

d. half life

11. One way to make sure that a variable has been assigned a value is to __________ the variable with a
value when you declare it.

a. concatenate

b. initialize
c. delimit

d. restrict

12. You can use a __________ to explicitly convert a value from one numeric data type to another, even
if the conversion might result in a loss of data.

a. transpose statement

b. cast operator

c. conversion operator

d. literal conversion

13. The process of dropping a number’s fractional part is called __________.

a. shifting

b. twos complement

c. numeric rounding

d. truncation

14. A programmer’s tools for performing calculations are __________.

a. math

b. numeric literals

c. local variables

d. parsed literals

15. A __________ performs a calculation and gives a value.

a. numeric literal

b. math expression

c. machine instruction

d. programming statement

16. C# offers a special set of operators known as __________ that are designed specificcally for changing
the value of a variable without having to type the variable name twice.

a. combined assignment operators

b. advanced math operators

c. variable modifiers

d. assignment sequencers
17. In computer science, the term __________ typically means to analyze a string of characters for some
purpose.

a. compile

b. compute

c. debug

d. parse

18. A(n) __________ is a piece of data that is passed into a method.

a. variable

b. argument

c. string

d. literal

19. A(n) __________ is an unexpected error that occurs while a program is running, causing the program
to halt if the error is not properly dealt with.

a. breakpoint

b. bug

c. syntax error

d. exception

20. The __________ indicates that you want the number to appear formatted in a specific way when it is
returned as a string from the To String method.

a. formatting string

b. insert method

c. data type

d. variable name

21. You have started an application by clicking the start Debugging button ( ) or by pressing % on the
keyboard. If an exception is thrown, the application stops running and Visual Studio goes into a special
mode known as __________.

a. exception mode

b. break mode

c. debug mode

d. crash mode
22. Code that responds to exceptions when they are thrown and prevents the program from abruptly
crashing is called a(n) __________.

a. exit strategy

b. fail safe

c. event handler

d. exception handler

23. A __________ is a name that represents a value that cannot be changed during the program’s
execution.

a. named literal

b. named constant

c. variable signature

d. key term

24. A __________ is a variable that is declared inside a class but not inside any method.

a. term

b. class variable

c. field

d. mnemonic

25. A(n) __________ specifies how a class member can be accessed by code outside the class.

a. namespace

b. access modifier

c. scope delimiter

d. class directive

26. A __________ is a field that cannot be changed by any statement in the class.

a. static field

b. class name

c. key field

d. constant field

27. The .NET Framework provides a class named __________, which contains numberonus methods
that are useful for performing advanced mathematical operations.

a. Math
b. Calc

c. Trig

d. Linq

28. When a control has the __________, it receives the user’s keyboard input.

a. text

b. tab order

c. focus

d. input allocator

29. The order in which controls receive the focus is called the __________.

a. order of operations

b. program flow

c. execution sequence

d. tab order

30. The __________ contains a numeric value, which indicates the control’s position in the tab order.

a. Index Of property

b. TabIndex property

c. Control Order property

d. Tab Order property

True or False
1. You can clear the contents of a Textbox control in the same way that you clear the contents of a Label
control.

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

3. You can declare multiple variables of different data types with one declaration.

4. When you append the letter D or d to a numeric literal, it is treated as a decimal and is referred to as
a decimal literal.

5. The order of operations dictates that the division operator works before the AddiTion operator does.
6. All variables have a To String method that you can call to convert the variable’s value to a string.

7. When you pass the formatting string "C" or "c" to the To String method, the number is returned
formatted as currency.

8. When you declare a named constant, an initialization value is required.


9. An error will occur if the compiler finds a statement that tries to change the value of a constant field.
10. Forms and most controls have a preferences property that allows you to change the object’s
background color.

Short Answer
1. In the Toolbox, in which group is the Textbox tool located?

2. What two things does a variable declaration specify about a variable?

3. Give an example of a programming statement that uses string concatenation.

4. What is the term used for a number that is written into a program’s code?

5. Write a programming statement that assigns an integer literal to a variable.

6. What are the values on the right and left of an operator called?

7. Name the family of methods in the .NET Framework that can be used to convert a string to any of the
numeric data types.

8. What object is created in memory when an exception is thrown and has various properties that
contain data about the exception?

9. What is the purpose of a try-catch statement?

10. Which class in the .NET Framework provides predefined named constants that are assigned the
mathematical values for pi and e?

11. In code, what function do you call to move the focus to a control?

. What property allows you to change the color of a control’s text?

CHAPTER THREE

You might also like