Self Review Exercises 6 Flashcards

1
Q

SRE 6

Programmers normally use ______

a) programmer-defined methods
b) pre-existing methods
c) both programmer-defined and pre-existing methods
d) neither programmer-defined nor pre-existing methods

A

c) both programmer-defined and pre-existing methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

SRE 6

The ______ statement in a Function sends a value back to the calling method.

a) Return
b) Back
c) End
d) None of the above

A

a) Return

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SRE 6

Arguments passed to a method can be _______

a) constants
b) expressions
c) variables
d) all of the above

A

d) all of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SRE 6

The ______ is a comma separated list of declarations in a method header.

a) argument list
b) parameter list
c) value list
d) variable list

A

b) parameter list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SRE 6

During debugging, the ______ command executes the remaining statements in the current method and returns program control to the place where the method was called

a) Step Into
b) Step Out
c) Step Over
d) Steps

A

b) Step Out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SRE 6

The debugger command ______ behaves like the Step Over command when the next statement to execute does not contain a method call.

a) Step Into
b) Step out
c) Step over
d) Steps

A

a) Step Into

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

SRE 6

Instant variables have _____ scope

a) block
b) method
c) class
d) None of the above

A

c) class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

SRE 6

Variables with either method scope or block scope are called ______.

a) instance variables
b) local variables
c) class variables
d) hidden variables

A

b) local variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

SRE 6

When Option Strict is set to On, you must explicitly perform _______.

a) narrowing conversions
b) widening conversions
c) all type conversions
d) no conversions

A

a) narrowing conversions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

SRE 6

The methods in class _____ are used to perform explicit conversions.

a) Strict
b) Change
c) Convert
d) Conversion

A

c) Convert

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

SRE 6

The Statement _____ returns a number in the range from 8 to 300.

a) randomObject.Next(8, 300)
b) randomObject.Next(8, 301)
c) 1 + randomObject.Next(8, 300)
d) None of the above

A

b) randomObject.Next(8, 301)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

SRE 6

The statement _____ returns a number in the range 15 to 35

a) randomObject.Next(15,36)
b) randomObject.Next(15, 35)
c) 10 + randomObject.Next(5, 26)
d) Both 1 and 3

A

d) Both 1 and 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

SRE 6

Use keyword _____ to define groups of related constants.

a) ReadOnly
b) Enum
c) Constants
d) Enumeration

A

b) Enum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

SRE 6

The constants defined in an Enum _____

a) may use repeated values
b) can be accessed using the Enum’s name followed by the member access operator
c) are not required to declare a value
d) All of the above

A

d) All of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

SRE 6

To clear the image in a PictureBox, set its Image property to _______

a) “”
b) Nothing
c) None
d) Empty

A

b) Nothing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

SRE 6

True or False: Conversion of a data item from type Single to type Double is an example of a widening conversion

A

True

17
Q

SRE 6

True or False: Variables of type Char cannot be converted to type Integer

A

False. Type Char variables can be converted to type Integer with a narrowing conversion

18
Q

SRE 6

True or False: Option Explicit causes the compiler to check all conversions and requires you to perform an explicit conversion for all narrowing conversions that could cause data loss or program termination

A

False. Option Strict causes the compiler to check all conversions and requires you to perform an explicit conversion for all narrowing conversions that could cause data loss or program termination. Option Explicit forces you to explicitly declare all variables before they’re used in a program.

19
Q

SRE 6

True or False: When an argument is passed by value, the program makes a copy of the argument’s value and passes the copy to the called method.

A

True