Docsity

Exam 1 with Answer Sheet - Introduction to Computing | CS 1301, Exams of Computer Science

Toggle sidebar
bg1
CS 1301 Exam 1 – Answer Sheet - Spring 2009
NOTE: Question 33 & 34 are located on the back of this sheet!
Your Name:_____________________ Your TA's Name: ________________ (5pts)
Please answer multiple choice questions 1 - 20 in the following spaces. Mark you answer by
completely filling the circle to the right of the corresponding letter.
1. A O B O C O D O E O 11. A O B O C O D O E O
2. A O B O C O D O E O 12. A O B O C O D O E O
3. A O B O C O D O E O 13. A O B O C O D O E O
4. A O B O C O D O E O 14. A O B O C O D O E O
5. A O B O C O D O E O 15. A O B O C O D O E O
6. A O B O C O D O E O 16. A O B O C O D O E O
7. A O B O C O D O E O 17. A O B O C O D O E O
8. A O B O C O D O E O 18. A O B O C O D O E O
9. A O B O C O D O E O 19. A O B O C O D O E O
10. A O B O C O D O E O 20. A O B O C O D O E O
B. Please answer True/False questions 21-30 in the following spaces. Mark you
answer by completely filling the circle under the corresponding answer.
True False True False
21. O O 26. O O
22. O O 27. O O
23. O O 28. O O
24. O O 29. O O
25. O O 30. O O
31. 32.
pf3
pf4
pf5
pf8

Partial preview of the text

Download Exam 1 with Answer Sheet - Introduction to Computing | CS 1301 and more Exams Computer Science in PDF only on Docsity!

CS 1301 Exam 1 – Answer Sheet Spring 2009

NOTE: Question 33 & 34 are located on the back of this sheet! Your Name:_____________________ Your TA's Name: ________________ (5pts) Please answer multiple choice questions 1 20 in the following spaces. Mark you answer by completely filling the circle to the right of the corresponding letter.

  1. A O B O C O D O E O 11. A O B O C O D O E O

  2. A O B O C O D O E O 12. A O B O C O D O E O

  3. A O B O C O D O E O 13. A O B O C O D O E O

  4. A O B O C O D O E O 14. A O B O C O D O E O

  5. A O B O C O D O E O 15. A O B O C O D O E O

  6. A O B O C O D O E O 16. A O B O C O D O E O

  7. A O B O C O D O E O 17. A O B O C O D O E O

  8. A O B O C O D O E O 18. A O B O C O D O E O

  9. A O B O C O D O E O 19. A O B O C O D O E O

  10. A O B O C O D O E O 20. A O B O C O D O E O B. Please answer True/False questions 2130 in the following spaces. Mark you answer by completely filling the circle under the corresponding answer. True False True False

  11. O O 26. O O

  12. O O 27. O O

  13. O O 28. O O

  14. O O 29. O O

  15. O O 30. O O

  16. Python Expression Evaluation (14 points) Pretend that you are the Python Interpreter (IDLE window). What do you print or return when each of the following statements are entered? What type is it? Example: (7+4) / 2 Result: 5 Type: int Example: "Hi" + “Bye” Result: "HiBye" Type: string

    1. (15.0 + 4 ) / 2 _Result:_____________ Type:_________
    2. 9 ** 2 _Result:_____________ Type:_________
    3. "Hi" * 3 _Result: _____________ Type:_________
    4. int( 5.135 ) _Result: _____________ Type:_________
    5. 9 > 5.0 _Result: _____________ Type:_________
    6. 3 > 8 - 21/2 _Result: _____________ Type:_________
  17. Write the number from the correct definition in the blank next to each term on the left: (14 points) ___Print statement ___Program ___Runtime error ___Semantic error ___Syntax error ___Floatingpoint ___Integer ___Integer division ___Keyword ___Operator ___Variable ___Function ___function call ___Type conversion

    1. A special symbol that represents a simple computation like addition, multiplication, or string concatenation.
    2. An error in a program that makes it impossible to parse (and therefore impossible to interpret).
    3. An instruction that causes the Python interpreter to display a value on the screen.
    4. A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses.
    5. An error in a program that makes it do something other than what the programmer intended.
    6. A sequence of instructions that specifies to a computer actions and computations to be performed.
    7. A reserved word that is used by the compiler to parse a program; you cannot use things like if, def, and while as variable names.
    8. A format for representing numbers with fractional parts.
    9. An explicit statement that takes a value of one type and computes a corresponding value of another type.
    10. A named sequence of statements that performs some useful operation. They may or may not take parameters and may or may not produce a result.
    11. An error that does not occur until the program has started to execute but that prevents the program from continuing.
    12. An operation that divides one integer by another and yields an integer. It yields only the whole number of times that the numerator is divisible by the denominator and discards any remainder.
    13. A name that refers to a value.
    14. A Python data type that holds positive and negative whole numbers.
  1. Spacewar, perhaps the worlds first computer game, was created in 1962: A. At MIT B. At Berkeley C. At Stanford D. At Harvard E. At both B & D in collaboration
  2. Douglas Engelbart demonstrated the world’s first _________ in 1964 at Stanford. A. Transistorized Computer B. Solid Sate Memory C. Mouse D. Tape Drive E. Transistor a = 5 b = 6 a = b
  3. If the above code is run, the variable ‘a’ contains: A. 5 B. 6 C. False D. None of the above
  4. 1 – (5%5) + 2 * 1 evaluates to: A. 3 B. 2 C. 0 D. 1
  5. The transistor: A. Was invented by John Eckert and John Mauchly B. Was invented by William Shockley and Walter Brattain C. Was invented at Bell Labs D. A&C E. B&C
  1. The software that really kickstarted the personal computer market was: A. Word Perfect B. VisiCalc C. Microsoft DOS D. Spacewars E. Pong
  2. Alan Turing is famous for: A. His work on FORTRAN B. Developing the first interpreted language C. His work in machine intelligence D. Creating the transistor E. None of the above
  3. 3**(2)3 evaluates to: A. 0 B. 3 C. 5 D. 6
  4. One of the earliest networks was: A. Gophernet B. ARPAnet C. HYPERnet D. HTTPnet E. Travnet print type(“3”) == str
  5. If you run the above line of code, you’ll print out: A. True B. False C. str D. String E. None of the above
  6. If you execute the code print (True == False) == False what is printed? A. True B. False C. bool D. int E. None of the previous
  1. The binary number { 1101010 } 2 is what decimal (base 10) number? A. 106 B. 111 C. 102 D. 110 E. 112 B. True/False questions – fill in the circle corresponding to the correct answer on the answer sheet (page 1). Be sure you double check that you have marked the answer corresponding to the correct number!
    1. You can name your robot using the nameRobot( ) function.
    2. In RGB color, (255, 255, 255) is true black.
    3. The beep() function causes your computer to beep.
    4. The speak() function will generate audible speech from a string.
    5. Proprioception refers to external sensors.
    6. If you want to make your robot wait, you can use the pause() function.
    7. The Spirit and Opportunity mars rovers were expected to last about 90 days.
    8. ‘print’ and ‘return’ do the same thing.
    9. Python variable names can’t contain numbers.
    10. The bottom left corner of a default Myro graphics window is at location 0,0. C. Write Code!
  2. Write a function named "average_three_numbers” (without the quotes). It should take in three parameters named numOne, numTwo, and numThree, and return the average of the three numbers. Write your function in box 31 on the answer sheet (page 1).
  3. Write a function named isDivisible that takes two parameters which you can assume are integers. Your function should return 1 if the first parameter is evenly divisible by the second. Otherwise, your function should return 0. Write your function in box 32 on the answer sheet (page 1). Hint, you may want to use the modulo ( % ) operator.

This page is intentionally left blank. Feel free to use it for scratch work. This test has a total of 34 questions (question 33 & 34 are on the back of page 1, the answer sheet). Did you do them all?