fall 2009 cs 105 midterm

20
Warning Concerning Copyright Restrictions The Copyright law of the United States (Title 17, United States Code) governs the making of photocopies or other reproductions of copyright material. Under certain conditions specified in the law, libraries and archives are authorized to furnish a photocopy or other reproduction. One of these specified conditions is that the photocopy or reproduction not be "used for any purposes other than private study, scholarship, or research." If a user makes a request for, or later uses, a photocopy or reproduction for purposes in excess of "fair use," that user may be liable for copyright infringement.

Upload: tyrone-blackridge

Post on 03-Oct-2014

46 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fall 2009 CS 105 Midterm

Warning Concerning Copyright Restrictions

The Copyright law of the United States (Title 17, United States Code) governs themaking of photocopies or other reproductions of copyright material. Under certainconditions specified in the law, libraries and archives are authorized to furnish aphotocopy or other reproduction. One of these specified conditions is that the photocopyor reproduction not be "used for any purposes other than private study, scholarship, orresearch." If a user makes a request for, or later uses, a photocopy or reproduction forpurposes in excess of "fair use," that user may be liable for copyright infringement.

Page 2: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

September 29th, 2009

DO NOT START UNTIL INSTRUCTED TO DO SO. YOU WILL LOSE POINTS IF YOU START WORKING ON THE TEST BEFORE WE TELL YOU TO.

Do not leave this blank—fill it in now: Name: Discussion Section: TA:

FORM A

On the scantron: Use only a #2 pencil; otherwise, your exam won't be graded. Bubble in the Form Letter above!!! Bubble in your name and your NetID!!! Write your TA's name (of the section you attend) in the instructor slot and your section

number in the section slot. Your section number is in the table provided at the bottom of this page.

About the test: The exam consists of 19 pages. Check that your copy is complete, and ask for a

replacement if it is not. Make sure you look at all the pages. You will have 1 hour to FILL IN THE SCANTRON for the exam. You may not use any

books, notes, or other references for this exam. NO QUESTIONS WILL BE ANSWERED DURING THE EXAM. At the end of the exam, stop writing and put down your pencil when time is called. Hand in

both the scantron and all the pages of the exam booklet. NO CALCULATORS OR ELECTRONIC DEVICES OF ANY KIND ARE ALLOWED.

TURN OFF CELL PHONES and PAGERS. IF A CELL PHONE RINGS, DO NOT ANSWER IT!!

Discussion section numbers and name of the TA whose lab you attend: Time Wednesday Thursday Friday 9:00 am AYE - Ankit AYN - I-Hong 10:00 am AYF - Ankit AYO - Wen 11:00 am AYG - Mianwei AYP - Marina 12:00 pm AYH - Tanmay AYQ - Giang 1:00 pm AYI - Marina AYR - Minas 2:00 pm AYJ - Lance AYS - Minas 3:00 pm AYA - Yunliang AYK - Lance AYT - Xiaokang 4:00 pm AYB - I-Hong AYL - Tanmay AYU - Xiaokang 5:00 pm AYC - Onur AYM - Yunliang 6:00 pm AYD - Onur

Page 3: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Note: Always choose the most correct choice of the answers offered.

Computer Concepts and Logic

1. Which base ten number does the binary number 1010111 correspond to?

a. 68 b. 87 c. 89 d. 92

2. If a binary number ends in a 0 then what does two plus that binary number end with?

a. 0 b. 1 c. 2 d. 4

3. How many different numbers you can represent with 6 bits?

a. 32 b. 64 c. 128 d. 256

Page 4: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Use the following diagram for the NEXT question. (Remember: 0 = False, 1 = True)

4. Which logical operator must be placed in the empty box in order for the logic to output 1?

a. AND b. OR c. NOT d. It is impossible to return 1 using AND, OR, or NOT.

Page 5: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Use the following diagram for the NEXT question. (Remember: 0 = False, 1 = True)

5. What does the above logic return?

a. 0 b. 1 c. Infinity d. 1/2

6. Which of the following is NOT a valid logical equivalence of formulas (where we have used the  equal  sign  “=”  to  denote  logical  equivalence)?

a. NOT (A AND B) = (NOT A) OR (NOT B) b. NOT (A OR B) = (NOT A) AND (NOT B) c. A OR (NOT A) = NOT A d. NOT (NOT (NOT A) ) ) = NOT A

Page 6: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

7. Complete the truth table for the logical formula A OR (B AND A). (Remember: 0 = False, 1 = True)

A B A OR (B AND A)

1 1 ?

1 0 ?

0 1 ?

0 0 ?

a. 1

1 1 0

b. 1 1 0 0

c. 1 0 1 0

d. 1 1 1 1

8. A computer network that is located within a limited geographical area is called _____.

a. the internet b. TCP/IP c. a LAN d. a web site

9. Which of the following statements is FALSE?

a. A computer can accept input from a mouse. b. The keyboard is a common output device. c. A microphone may be used as an input device. d. A monitor is a common output device.

10. Data stored here is lost when your computer is turned off.

a. Hard drive b. RAM c. Flash drive d. CD

Page 7: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Excel

Use the following screenshot to answer the NEXT TWO questions.

11. What will be displayed in cell D1 if the formula =B1*B2^A2+A1 is entered in cell D1? Hint: from lowest to highest precedence + , - , * , / , ^, - (unary), ()parenthesis a. 13 b. 15 c. 24 d. 37

12. What will be displayed in cell E2 if the formula in D1 is copied and pasted into E2?

a. 4 b. 5 c. 13 d. 24

Page 8: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Use the following screenshot to answer the NEXT THREE questions.

13. What will be displayed in cell D1 if the formula =B$2*$C1 is entered in cell D1?

a. 6 b. 17 c. 24 d. 25

14. What will be displayed in cell E2 if the formula in D1 is cut and pasted onto E2?

a. 6 b. 17 c. 24 d. 25

15. What will be displayed in cell E2 if the formula in D1 is copied and pasted onto E2?

a. 6 b. 17 c. 24 d. 25

Page 9: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Use the following screenshot to answer the NEXT TWO questions.

16. We want to enter a formula in cell E2 to compute the total points of a student and then fill the formula into E3:E5. What formula should we enter?

a. =B$2+C$2+D$2 b. =SUM(B2:B5) c. =SUM(B2:D2) d. =$B$2+$C$2+$D$2

17. We want to enter a formula in F2 to compute the percentage that a student gets in each homework and then fill the formula to F2:I5. What formula should we enter?

a. =$B2/$B7 b. =B2/B$7 c. =B2/B7 d. =B2/$B7

Page 10: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Use the following flowchart to answer the NEXT TWO questions.

18. What formula describes the above flowchart?

a. =IF(A=B, "Result 1", IF(C>D, "Result 1", "Result 2")) b. =IF(A=B, IF(C>D, "Result 1", "Result 2"), "Result 1") c. =IF(A=B, "Result 1",= IF(C>D, "Result 1", "Result 2")) d. =IF(A=B, IF(C>D, "Result 2", "Result 1"),"Result 1")

19. Which of the following formulas is equivalent to the flowchart?

a. =IF(A=B OR C>D, "Result 1", "Result 2") b. =IF(AND(A=B,C>D), "Result 1", "Result 2") c. =IF(A=B AND C>D, "Result 1", "Result 2") d. =IF(OR(A=B,C>D), "Result 1", "Result 2")

TRUE

A = B

C > D

Result 1

Result 1

Result 2

TRUE

FALSE

FALSE

Page 11: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

20. Suppose we have a workbook with two spreadsheets named Price and Surcharge. We want to compute the sum of cell A2 in the Price worksheet and cell B3 in the Surcharge worksheet and display the result in cell D1 in the Surcharge worksheet. What is the correct formula to enter in cell D1 in the Surcharge worksheet?

a. = A2 + B3 b. = A2 + Surcharge!B3 c. = A2 + 'Surcharge'!B3 d. = Price!A2 + B3

21. The image of the spreadsheet below is in formula view:

Which cell displays TRUE when the spreadsheet is returned to normal view?

a. A1 b. A2 c. A3 d. A4

Page 12: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

The NEXT THREE questions refer to the Marginal Tax Rate table below:

22. Person  1  filed  with  “Single”  status (see column D above).

Which  is  the  correct  formula  to  lookup  Person  1’s  Marginal  Tax  Rate?

a. =VLOOKUP(C14, D4:G8, 4) b. =HLOOKUP(C14, D4:G8, 3) c. =VLOOKUP(D14, E4:G8, 2) d. =HLOOKUP(D14, E3:G8, 1)

23. Which is the value of the formula =HLOOKUP(90000, D6:E7, 2)?

a. $82,250 b. $117,450 c. $171,550 d. $190,200

24. The  following  3  people  file  with  “Head  of  Household”  status.

Which formula, entered in cell D23, is suitable for the fill handle to lookup their Marginal Tax Rates by filling across row 23?

a. =VLOOKUP(D22, E4:G8, 3) b. =HLOOKUP(D22, $E4:$G8, 4) c. =VLOOKUP(D22, $E4:$G8, 3) d. =HLOOKUP(D22, $E$4:$G$8, 4)

Page 13: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Use the following screenshot to answer the NEXT question.

25. Suppose you want to display the number of players that have more than 30 homeruns in cell B8, what is the correct formula?

a. = COUNTIF(B2:B7, ">30") b. = COUNT(B2:B7, ">30") c. = COUNTIF(B2:B7, ">=30") d. = COUNT($B$2:$B$7, ">=30")

Page 14: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

VBA

26. In Excel, to use an accelerator, the user would hold down the _____ key and press the accelerator letter.

a. Esc b. Shift c. Ctrl d. Alt

27. Which of the following is NOT a type of VBA control object?

a. button b. text box c. check box d. formula

28. Which of the following is NOT allowed as the name of a VBA control object?

a. MyCmdButton b. 2ndButton c. cmdButton d. MyButton2

29. Which of the following type of characters is NOT allowed in VBA control names?

a. upper-case letters (eg, A, B, C, etc) b. lower-case letters (eg, a, b, c, etc) c. special characters (eg, !, @, #, etc) d. numbers (eg, 1, 2, 3, etc)

30. Which mode allows you to create, modify, and code VBA control objects?

a. Design Mode b. Control Mode c. Active Mode d. Regular Mode

Page 15: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

31. Which of the following is NOT an object method?

a. Activate b. Clear c. Name d. Select

Use the following screen shot for the NEXT question.

32. What is the code that generated the above Message Box?

a. MsgBox "Are you having fun?", vbOkCancel, "Are you enjoying the midterm?"

b. MsgBox "Are you having fun?", vbYesNo, "Are you enjoying the midterm?"

c. MsgBox "Are you enjoying the midterm?", vbOkCancel, "Are you having fun?"

d. MsgBox "Are you enjoying the midterm?", vbYesNo, "Are you having fun?"

Page 16: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Use the following screen shot for the NEXT question.

33. In VBA, which  line  of  code  will  put  “Hello  world”  in  the  active  cell?

a. D3 = "Hello world" b. Range(4,3).Value = "Hello world" c. Cells("D3").Value = "Hello world" d. Cells(3,4).Value = "Hello world"

Page 17: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Use the following screen shot for the NEXT TWO questions.

34. After running the subprocedure cmdChampaign_Click on a blank worksheet, what are the correct values displayed in cells A1, A2 and A3 ?

a. A1="Illini", A2="Buffalo Wild Wings", A3="" b. A1="", A2="Illini", A3="Buffalo Wild Wings" c. A1="Illini", A2="Illini", A3="Buffalo Wild Wings" d. A1="", A2="Buffalo Wild Wings", A3=""

35. After running the subprocedure cmdRun_Click on a blank worksheet, what are the correct values displayed in cells A1, A2 and A3 ?

a. A1="Deep dish pizza", A2="Navy Pier", A3="" b. A1="Deep dish pizza", A2="Illini", A3="Buffalo  Wild  Wings” c. A1="Deep dish pizza", A2="Navy Pier", A3="Buffalo Wild Wings" d. A1="Deep dish pizza", A2="Illini", A3 = ""

Page 18: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

36. In VBA, what would be the correct code to display an Input Box for the user to enter a number, and then place that number into cell C5?

a. Range("C5").Value = InputBox("Enter a number", "Number") b. InputBox("Enter a number", "Number") = Range("C5").Value c. ("C5").Value= InputBox("Enter a number", "Number") d. Range("C5").Value(InputBox("Enter a number", "Number"))

Use the following screen shot for the NEXT question.

37. Which of the following choices assigns 11 to cell B5?

a. Range("B5").Value = Range("B2").Value + Cells(2,3).Value b. Range("B5").Value = Cells(3,2).Value + Cells(3,3).Value c. Range("B5").Value = Cells(3,2).Value + Cells(2,3).Value d. Range("B5").Value = Cells(2,2).Value + Range("C3").Value

38. If you wish to change the text displayed on a command button that the user sees. What property of the button do you change?

a. Name b. Caption c. Text d. Value

Page 19: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

39. Which of the following lines of code will result in cell A1 displaying the string, “Jack  and  Jill  went  up  the  hill”?

a. Range("A1").Value = AND("Jack and Jill ", "went up the hill") b. Range("A1").Value = "Jack and Jill " & "went up the hill" c. Range("A1").Value = "Jack" & "and" & "Jill" & "went" & "up" _

& "the" & "hill" d. Range("A1").Value = "Jack and Jill "_ &

"went up the hill" Use the following screen shot for the NEXT question.

40. Which VBA code would enable the command button named cmdTest?

a. cmdTest.Enabled = True b. cmdTest.Disabled = False c. cmdTest.Enabled d. Test.Enabled

Page 20: Fall 2009 CS 105 Midterm

Midterm 1 CS105 Fall 2009

Extra Credit

Extra Credit: You will not lose any points if you get this question wrong. You will, however, gain points if you answer it correctly. The maximum score possible remains 160 points. Use the following screen shot for the NEXT question.

41. Which subprocedure correctly implements the logic of the above diagram? a.

b.

c.

result  of  clicking  “Yes” result  of  clicking  “No”