
CS 10061 Introduction to Computer Science, Section 1 Midterm I February 17,
2010
CS 10061 Introduction to Computer Science
Section 1
Spring 2010
Call Number 11591
First Midterm
February 17, 2010
YOUR NAME: Answer key ( answers may vary )
Part 1 (Fill in the blank)
1. In C++, legal identifiers may contain these kinds of characters letters ,
digits , underscore (_)
2. In C++, a variable that has been defined but not initialized may not be use as an l-value . (l-
value or r-value).
3. Identifiers should at least give a hint to the human reader of the meaning/use of the
identifier in the context of the problem being solved.
4. The literal 'A' represents a character (char) .
5. The value of the expression 5/3 is 1 . (quotient on integer division)
Part 2 (Programming fragment exercises)
1. Declare a variable pay of type double.
double pay;
2. Write a statement that finds the average of two variables (already declared as type double)
called old and new and stores the result in a variable called result which has already been
declared double)
result = (old + new) /2;
Page 1