cs10_07spr_mt_sol

cs10_07spr_mt_sol - Last name: _ SID (last 4 digits): _...

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

View Full Document Right Arrow Icon
Last name: _____________________ First name: ___________________________ SID (last 4 digits): __________ login id: __________ CS 010 – Intro to Computer Science I Spring - 2007 Mid-term exam Friday 5/4 – total 100 points SOLUTION Time: 50 mins. You may have on your desks ONLY this exam, your personalized multiple choice answer sheet, a writing implement and an eraser, and your student ID. You may use a separate sheet(s) of scratch paper. Make good use of them – don’t write your answers in the assigned space until you are sure of them! WRITE CLEARLY IN THE SPACE PROVIDED. WARNING !!!: POINTS WILL BE DEDUCTED FOR MESSY & HARD-TO-READ HANDWRITING!!! Section I (questions 1 to 25) is to be answered on your multiple choice answer sheet; Section II (questions 1 & 2) on this exam booklet. Hand both in together. You will be required to show your student ID when you hand in your exam. Be sure to read each problem carefully and follow the directions. Section I 50 Section II Q.1 25 Section II Q.2 25 TOTAL 100
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Section I: Multiple choice – 2 points each 1. The Linker is a program that: a. checks the internal consistency of the source code b. translates assembly language code into machine language c. translates source code into assembly language d. translates source code into machine language e. takes one or more object files and builds them into an executable image. 2. Which of the following is NOT a valid assignment statement (assume all variable names have been properly declared and initialized)? a. product = n * m; b. n + m = sum; c. result = result + 5; d. 5 = n – m; e. b) and d) f. c) and d) 3. In C++, a variable: a. gives a name to a location in memory that holds a value b. takes up a different amount of space in memory depending on its type c. can have its value changed by certain statements in a program d. should be given meaningful names to help the readability of a program e. exists in memory only when the program is running f. all of the above 4. Which of the following is an example of a literal ? a. 10 b. 4.5 c. “count” d. count e. All except d) are literals f. None of the above is a literal 5. What will be stored in the variable called result after the following statements have executed? (Hint: 10 and 20 are both integer literals ) double result; result = 10 / 20; a. 0.5 b. 0.0 c. 10 d. 1.0 e. 1
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This test prep was uploaded on 04/15/2008 for the course CS 10 taught by Professor Linard during the Spring '07 term at UC Riverside.

Page1 / 9

cs10_07spr_mt_sol - Last name: _ SID (last 4 digits): _...

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