ID-CODE: _____________
DATE: _____
Instructions:
Answer the questions in the order given. 
You are allowed neither to modify the recorded time nor to go back to previous questions. 

1. SET CHRONOMETER AT ZERO. 
Minutes 	Seconds 	100ms of a second 	
0	0	0	

>>> START CHRONOMETER <<<

Consider the program fragment below
x=++y; 

(a) what is the final value of x if y is  –10. Answer ___
(b) what is the final value of x if y is  0. Answer ___
(c) what is the final value of x if y is  10. Answer ___

>>> STOP CHRONOMETER AND WRITE DOWN THE TIME RECORDED <<<

Minutes 	Seconds 	100ms of a second 	

2. SET CHRONOMETER AT ZERO. 
Minutes 	Seconds 	100ms of a second 	
0	0	0	

>>> START CHRONOMETER <<<

Consider the program fragment below
x=y++; 

(a) what is the final value of x if y is  -10. Answer ___
(b) what is the final value of x if y is  0. Answer ___
(c) what is the final value of x if y is  10. Answer ___

>>> STOP CHRONOMETER AND WRITE DOWN THE TIME RECORDED <<<

Minutes 	Seconds 	100ms of a second 	

3. SET CHRONOMETER AT ZERO. 
Minutes 	Seconds 	100ms of a second 	
0	0	0	

>>> START CHRONOMETER <<<

Consider the C program fragment below

if( x++ ==y && x-- == z ) p=1; 
else p=2; 

(a) what is the final value of p if x is 10, y is 11, z is 10. Answer ___
(b) what is the final value of p if x is 10, y is 10, z is 10. Answer ___
(c) what is the final value of p if x is 10, y is 9, z is 10. Answer ___
(d) what is the final value of p if x is 10, y is 11, z is 11. Answer ___
(e) what is the final value of p if x is 10, y is 10, z is 11. Answer ___
(f) what is the final value of p if x is 10, y is 9, z is 11. Answer ___

>>> STOP CHRONOMETER AND WRITE DOWN THE TIME RECORDED <<<

Minutes 	Seconds 	100ms of a second 	

4. SET CHRONOMETER AT ZERO. 
Minutes 	Seconds 	100ms of a second 	
0	0	0	

>>> START CHRONOMETER <<<

Consider the C program fragment below

if (++i!=0) x=i++; 
else x=--i; 

(a) what is the final value of x if i is -1. Answer ___
(b) what is the final value of x if i is 0. Answer ___
(c) what is the final value of x if i is 1. Answer ___

>>> STOP CHRONOMETER AND WRITE DOWN THE TIME RECORDED <<<

Minutes 	Seconds 	100ms of a second 	

5. SET CHRONOMETER AT ZERO. 
Minutes 	Seconds 	100ms of a second 	
0	0	0	

>>> START CHRONOMETER <<<

Consider the C program fragment below

if(i++>0) {x=i++;}
else {x=--i;} 
i=++x;  

(a) what is the final value of i if the initial value of i is -1. Answer ___
(b) what is the final value of i if the initial value of i is 0. Answer ___
(c) what is the final value of i if the initial value of i is 1. Answer ___

>>> STOP CHRONOMETER AND WRITE DOWN THE TIME RECORDED <<<

Minutes 	Seconds 	100ms of a second 	

6. SET CHRONOMETER AT ZERO. 
Minutes 	Seconds 	100ms of a second 	
0	0	0	

>>> START CHRONOMETER <<<

Consider the C program fragment below

if (i=0) i++; 
else i--; 
x=i--;

(a) what is the final value of x if i is -1. Answer ___
(b) what is the final value of x if i is 0. Answer ___
(c) what is the final value of x if i is 1. Answer ___

>>> STOP CHRONOMETER AND WRITE DOWN THE TIME RECORDED <<<

Minutes 	Seconds 	100ms of a second 	

7. List the preceeding question numbers according to how hard you found them to answer. The first element of the list should be the question you found hardest to answer.