sample midterm 2 Flashcards

1
Q

What is the proper defination of a return statement?

a) Terminates execution of the method and returns the result to the calling program
b) Terminates execution of the method and returns to the calling program
c) Continues execution of the method and returns the result to the calling program
d) Continues execution of the method and does not return the result to the calling program

A

a) Terminates execution of the method and returns the result to the calling program

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

What is the technique used to break down larger programs into smaller pieces?

a) Divide and Conquer
b) Divide and Code
c) Dive-in and Code
d) Dive-in and Conquer

A

a) Divide and Conquer

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

What are the two types of methods?

a) Functions and Methods
b) Subroutines and Methods
c) Functions and Subroutines
d) Methods and Classes

A

c) Functions and Subroutines

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

Controls such as command buttons can be added to Windows Applications by which method?

a) Double clicking the control in the toolbox.
b) Both dragging and dropping the control as well as double clicking on the control.
c) Dragging and dropping the control.
d) None of the answers will add a control.

A

c) Dragging and dropping the control.

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

Which of the following properly defines pass by reference with respect to passing arguments?

a) The program gives the calling method the ability to access and modify the caller’s original data directly.
b) The program makes a copy of the argument’s value and passes the copy to the called method.
c) The program gives the called method the ability to access and modify the caller’s original data directly.
d) The program makes a copy of the argument’s value and passes the copy to the calling method.

A

c) The program gives the called method the ability to access and modify the caller’s original data directly.

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

Which of the following statements take the phrase “CMPP320 Final Exam” and puts it into a textbox.

a) “CMPP320 Final Exam” = txt_Name.text
b) txt_Name.property = “CMPP320 Final Exam”
c) “CMPP320 Final Exam” = txt_Name.property
d) txt_Name.text = “CMPP320 Final Exam”

A

d) txt_Name.text = “CMPP320 Final Exam”

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

What is a breakpoint?

a) Special markers which can be set at any unexecutable line of code.
b) Special markers which can be set at any executable line of code.
c) Special markers which cannot be set at any executable line of code.
d) Comments in code.

A

b) Special markers which can be set at any executable line of code.

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

What does the method call for a sub routine specify?

a) The method name alone.
b) The method name and the variable to store the return value.
c) The information supplied as arguments and a variable.
d) The method name and provides information such as arguments.

A

d) The method name and provides information such as arguments.

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

Methods accept parameters.

a) True
b) False

A

a) True

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

Which of the following is a Visual Basic method?

a) myFunction
b) addNumbers
c) volSphere
d) Math.PI

A

d) Math.PI

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

Which of the following is a valid return statment?

a) return
b) return(0)
c) return ( 1 + 5 + 12)
d) all are valid

A

d) all are valid

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

Which of the following best describes a function?

a) A method which returns a value to the caller.
b) A method which does not return a value.
c) Defines multiple tasks that run multiple times.
d) Defines a specific task and does not return the result to the calling program.

A

a) A method which returns a value to the caller.

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

What is a watch window?

a) A window to examine the declarations of the expressions contained within the program
b) A window to watch the program while it runs.
c) The window which displays the program.
d) A window to examine the values of the expressions contained within the program

A

d) A window to examine the values of the expressions contained within the program

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

What is the definition of step over?

a) Steps through each statement line by line, if the line is a method, the called method executes in its entirety and advances to the next executable line
b) Steps through each statement line by line unless it is a method and then it will transfer control to the called method
c) Steps through each statement line by line, if the line is a method, the called method executes in its entirety and advances to the next executable method
d) Steps through each statement line by line unless it is a method and then it will transfer control to the called method and executes every method from that point forward.

A

a) Steps through each statement line by line, if the line is a method, the called method executes in its entirety and advances to the next executable line

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

Which of the following best describes a sub routine?

a) A method which returns a value.
b) A method which does not return a value.
c) Defines multiple tasks that run multiple times.
d) Defines a specific task and returns the result to the calling program.

A

b) A method which does not return a value.

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

Which of the following best describes a method?

a) Performs a task and then returns a value to the calling program.
b) Define a specific taks that a program will use one or more times.
c) Performs a task by writing the same line code multiple times.
d) Defines multiple tasks that run multiple times.

A

b) Define a specific taks that a program will use one or more times.

17
Q

How is a function declared?

a) Sub method-name (parameter list) as return-type.
b) Function method-name (parameter list)
c) Function method-name (parameter list) as return-type.
d) Sub method-name (parameter list)

A

c) Function method-name (parameter list) as return-type.

18
Q

How is a function method invoked compared to a subroutine?

a) Calling it by name.
b) Calling it by name with an assignment operator.
c) Calling it by name without an assignment operator.
d) Calling it by name without and assignment operator but by passing it with parameters.

A

b) Calling it by name with an assignment operator.

19
Q

How is a method invoked?

a) A method call.
b) By using an assignment statement.
c) Calling Rover.
d) By declaring it public.

A

a) A method call.

20
Q

What do debuggers allow users to do?

a) Allow programmers to monitor the execution of a program to locate and remove logic errors.
b) Find errors in the program for the programmer.
c) Highlights errors for the programmer.
d) Allow programmers to monitor the execution of a program to locate and remove syntax errors.

A

a) Allow programmers to monitor the execution of a program to locate and remove logic errors.

21
Q

Visual Basic forms are identified with which suffix?

a) “.frm”
b) “.mak”
c) “.form”
d) “.vb”

A

d) “.vb”

22
Q

Which of the following properly defines pass by value with respect to passing arguments?

a) The program gives the called method the ability to access and modify the caller’s original data directly.
b) The program makes a copy of the argument’s value and passes the copy to the called method.
c) The program gives the calling method the ability to access and modify the caller’s original data directly.
d) The program makes a copy of the argument’s value and passes the copy to the calling method.

A

b) The program makes a copy of the argument’s value and passes the copy to the called method.

23
Q

How are breakpoints inserted and removed?

a) Right click on the margin or by pressing F9.
b) Left click on the margin or by pressing F10.
c) Left click on the margin or by pressing F9.
d) Right click on the margin or by pressiong F10.

A

c) Left click on the margin or by pressing F9.

24
Q

Which of the following is a call to a class method?

a) Math.Round(number,2)
b) “The number is {0:F2}” , number”
c) number.Round(2)
d) number(2).Round

A

a) Math.Round(number,2)