cs10_07fal_mt_001_sol

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

Info iconThis preview shows pages 1–4. 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 Fall - 2007 Mid-term exam -- section 001 -- Thursday 11/1 SOLUTION total 100 points Time: 80 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 to 3) 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 exactly. Section I 40 Section II Q.1 20 Section II Q.2 20 Section II Q.3 20 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
Last name: _____________________ First name: ___________________________ Section I: Multiple choice – 1.6 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 a meaningful name 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. All of the above are literals 5. Given the Time class of the text, which of the following statements correctly declares an object of type Time ? a. Time t = now(); b. Time breakfast(); c. Time lunch = Time(12, 15, 0); d. Time dinner = (17, 30, 0); e. b) and c) f. All of the above 6. Given the following variable declaration, which one of the following statements is legal ? const int SIZE = 34; a. SIZE++; b. x = SIZE--; c. cout << SIZE; d. cin >> SIZE; e. All of the above 2
Background image of page 2
Last name: _____________________ First name: ___________________________ f. None of the above 7. What value will be stored in the variable centigrade after the following statements have executed? double fahrenheit, centigrade;
Background image of page 3

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

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

Page1 / 12

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

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

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