sample midterm 2 Flashcards
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) Terminates execution of the method and returns the result to the calling program
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) Divide and Conquer
What are the two types of methods?
a) Functions and Methods
b) Subroutines and Methods
c) Functions and Subroutines
d) Methods and Classes
c) Functions and Subroutines
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.
c) Dragging and dropping the control.
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.
c) The program gives the called method the ability to access and modify the caller’s original data directly.
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”
d) txt_Name.text = “CMPP320 Final Exam”
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.
b) Special markers which can be set at any executable line of code.
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.
d) The method name and provides information such as arguments.
Methods accept parameters.
a) True
b) False
a) True
Which of the following is a Visual Basic method?
a) myFunction
b) addNumbers
c) volSphere
d) Math.PI
d) Math.PI
Which of the following is a valid return statment?
a) return
b) return(0)
c) return ( 1 + 5 + 12)
d) all are valid
d) all are valid
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 method which returns a value to the caller.
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
d) A window to examine the values of the expressions contained within the program
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) 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
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.
b) A method which does not return a value.