Online Exam

CCE 170 - Final Exam KEY

Fall Semester 2021

Page 1
[Page 2]
Page 3
Page 4
Page 5
Page 6
Page 7

Multiple Choice

(1 pt each)

2. (objects) Which of the following best describes the term methods as applied to VB objects?

a. methods are attributes of an object
   
b. methods are pre-defined ways for getting data from on objects
   
c. methods are things that happen to an object
   
d. methods are actions that can be performed by an object.
   
e. methods are techniques for storing data inside of objects

3. (objects) Which of the following represents a collection in Visual Basic?

a. Range (containing more than one cell)
   
b. Shapes
   
c. Comments
   
d. Sheets
   
e. All of the above are collections

4. (ifthen) The following line of code is supposed to check on the status of a checkbox control named chkRegistered:

If (chkRegistered.Value = False) Then

Which of the following statements is logically equivalent to this statement?

a.
If (chkRegistered = True) Then
   
b.
If (chkRegistered.Value) Then
   
c.
If (chkRegistered) Then
   
d.
If (Not chkRegistered) Then
   
e. All of the above are logically equivalent

5. (excel) If I am entering a formula in cell D10, which of the following cell references can be interpreted as "the cell in the same column as the current cell, but always on row 8"?

a. D8
   
b. D$8
   
c. $D8
   
d. $D$8

6. (controls) The default property for a checkbox or option control corresponds to which of the following VB types?

a. Integer
   
b. Double
   
c. String
   
d. Boolean
   
e. None of the above

7. (arrays) Which of the following properly creates an array of 21 doubles?

a. Dim x(1 To 21) As Double Array
   
b. Dim x(21) As Double
   
c. Dim x(1 To 21) as Double
   
d. Dim x[1 To 21] As Double Array
   
e. Dim x[21] As Double Array
   
f. None of the above

8. (variables) Which of the following statements properly tests to see if A is a multiple of B (B divides evenly into A)?

a. If A/B = Integer Then
   
b. If WholeNum(A, B) Then
   
c. If A Mod B Then
   
d. If A Mod B = 0 Then
   
e. If A Mod B = A Then
   
f. None of the above

9. (variables) Which of the following would be the best type to use for a variable containing the street address of a concrete supplier?

a. string
   
b. double
   
c. integer
   
d. boolean
   
e. variant

10. (variables) Which of the following variable types would be the best type to use for a variable that will contain the area of a polygon?

a. Integer
   
b. Double
   
c. Currency
   
d. String

11. (loops) Which of the following loops properly tests whether the integer num is a prime number? Assume the following declarations apply to all versions of the code:

Dim isprime As Boolean
Dim i As Integer

a.
isprime = True
For i = 2 To num - 1
  If num Mod i = 0 Then
    isprime = False
  End If
Next i
   
b.
isprime = False
For i = 2 To num - 1
  If num Mod i = 0 Then
    isprime = True
  End If
Next i
   
c.
isprime = True
For i = 2 To num
  If num Mod i = 0 Then
    isprime = False
  End If
Next i
   
d.
isprime = False
 For i = 1 To num - 1
   If num Mod i = 0 Then
     isprime = True
   End If
Next i

12. (ranges) If a cell is named flowrate, which of the following statements correctly gets the value from the cell and stores it in the variable num?

a. num = flowrate.Value
   
b. num = Range("flowrate")
   
c. num = Range(flowrate)
   
d. It is not possible to reference a cell from VB code using its name.

13. (ifthen) Which of the following is a proper way to test whether x is between 5 and 10, but not equal to either 5 or 10?

a. If 5 < x < 10 Then
   
b. If 5 <= x <= 10 Then
   
c. If x >= 5 And x <= 10 Then
   
d. If x > 5 And x < 10 Then
   
e. All of the above would achieve the same result

14. (compsci) How many bits are in 3.0 GB?

a. 3,000,000,000
   
b. 2^30 x 3 x 8
   
c. 3,000 x 2^8
   
d. 3,000,000,000 x 2^8
   
e. 3,000,000,000 x 8
   
f. 2^30 x 3

15. (word) In MS Word, I can make a link to an existing figure caption ("See Figure 3") that is automatically updated whenever I add or remove a caption using the _________ tool.

a. hyperlink
   
b. bookmark
   
c. cross reference
   
d. caption link
   
e. auto update
   
f. none of the above