CPROG1 MIDTERM
  • 1. is a group of statements that together perform a task when called. After the procedure is executed, the control returns to the statement
A) Procedure
B) Functions
C) Subs
D) Sub procedures
  • 2. is used to declare the name, parameter and the body of a function.
A) Sub procedures
B) Function
C) Subs
D) Procedure
  • 3. pecify the access level of the function; possible values are: Public, Private, Protected, Friend, Protected Friend and information regarding overloading, overriding, sharing, and shadowing.
A) ReturnType
B) ParameterList
C) FunctionName
D) Modifiers
  • 4. indicates the name of the function
A) FunctionName
B) ParameterList
C) ReturnType
D) Modifiers
  • 5. specifies the list of the parameters
A) Modifiers
B) ReturnType
C) ParameterList
D) FunctionName
  • 6. specifies the data type of the variable the function returns
A) FunctionName
B) ParameterList
C) Modifiers
D) ReturnType
  • 7. A function can call itself. This is known as recursion. Following is an example that calculates factorial for a given number using a recursive function
A) Passing Arrays as Function Arguments
B) Param Arrays
C) Recursive Function
  • 8. At times, while declaring a function or sub procedure, you are not sure of the number of arguments passed, come into help at these times.
A) Param Arrays
B) Recursive Function
C) Passing Arrays as Function Arguments
  • 9. You can pass an array as a function argument
A) Passing Arrays as Function Arguments
B) Param Arrays
C) Recursive Function
  • 10. is used to declare the name, parameter and the body of a sub procedure. The syntax for the Sub statement is
A) ByVal
B) Sub Procedures
C) ByRef
  • 11. This is the default mechanism for passing parameters to a method. In this mechanism, when a method is called, a new storage location is created for each value parameter.
A) Sub Procedures
B) ByRef
C) ByVal
  • 12. A reference parameter is a reference to a memory location of a variable. When you pass parameters by reference, unlike value parameters
A) Sub Procedures
B) ByVal
C) ByRef
Created with That Quiz — a math test site for students of all grade levels.