CS midterm1 practice

CS midterm1 practice - Winter 2004 CS 31 (Shinnerl)...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Winter 2004 CS 31 (Shinnerl) Practice Midterm Leave this grid blank, please. I II III Total Instructions: (i) Do not start yet! Keep the exam closed until instructed otherwise. (ii) One two-sided sheet of self-prepared notes only is allowed; otherwise, no books, notes, or calculating devices . You are not allowed to use your own scratch paper. The back pages of this exam may be used as such. Should you need more paper during the exam, more is available at the front of the room. (iii) Keep your photo-ID out on your desktop where the proctors can find it. They will come by during the test to check it. (iv) There is a strict time limit of 1 hour and 45 minutes for this exam. Time warnings will occasionally be posted on the board in front. When time is up, you must stop work immediately to avoid a 10% penalty. (v) This exam consists of three parts. There are 18 multiple-choice questions worth 2 points each in Part I, 5 short-answer questions worth 6 points each in Part II, and 4 short coding questions worth 10 points each in Part III. The total number of points possible is 106, of which 6 points are extra credit. The questions are not necessarily in order of increasing difficulty! Answer the easier questions first. Save difficult questions for last. (vi) Should corrections or hints be deemed necessary, they will be written on the board in front. (vii) Please provide the information requested below. Scores will be posted online at the my.ucla web site in a couple of days. Name (print) E-mail address: Student ID number: Signature: Discussion Section Number and Time: TAs Name: Winter 2004 CS 31 (Shinnerl) Practice Midterm 2 Part I: Multiple choice questions (2 points each) Select the single best answer to each question. Write your answers in the following table. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Question 1. What distinguishes the object-oriented paradigm from the procedural paradigm? (a) The latter is user-centric. The former is programmer-centric. (b) The latter is programmer-centric. The former is user-centric. (c) The latter is data-centric. The former is method-centric. (d) The latter is method-centric. The former is data-centric. (e) The former is concrete; the latter is abstract. Question 2. What is the principle of structured programming ? (a) Form follows function according to flow chart. (b) Premature optimization is the root of all evil. (c) Single entry, single exit. (d) Omit unnecessary code, but dont be too cryptic. (e) Useful code is modular and well documented. Question 3. If a and b are of type double , which of the following expressions is almost always meaningless? (a) a = b (b) a == b (c) a > b (d) a < b (e) a - b Question 4. Which order correctly summarizes the main categories of operator precedence in decreasing order (highest precedence first)?...
View Full Document

Page1 / 9

CS midterm1 practice - Winter 2004 CS 31 (Shinnerl)...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online