e2.s04 - ECE 199 Exam II Spring 2004 Tuesday, April 6 th ,...

Info iconThis preview shows pages 1–4. 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

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: ECE 199 Exam II Spring 2004 Tuesday, April 6 th , 2004 x Be sure that your exam booklet has 13 pages. x Write your name at the top of each page. x This is a closed book exam. x You are allowed one handwritten 8.5" x 11" sheet of notes. x Absolutely no interaction between students is allowed. x Show all of your work. x Be sure to clearly indicate any assumptions that you make. x More challenging questions are marked with a *** x Don¡t panic, and good luck! Problem 1 20 points _______________________________ Problem 2 20 points _______________________________ Problem 3 20 points _______________________________ Problem 4 20 points _______________________________ Problem 5 20 points _______________________________ Total 100 points Name: Page 2 Name: ____________________________________________ Problem 1 (20 points): Short Answer Part A (5 points): Give one reason for using local variables instead of global variables. Part B (5 points): Describe one advantage of using a debugger. Part C (5 points): Write the output of the following C code. for( i = 0 ; i < 4 ; i++) { i f ( i = = 2 ) c o n t i n u e ; f o r ( j = ; j < 4 ; j + + ) { i f ( j = = 2 ) b r e a k ; p r i n t f ( " % d % d \ n " , i , j ) ; } } Part D (5 points): You and a friend are charged with writing a function that reorganizes an array of integers by discarding any negative elements and adjusting the count of valid elements. Your friend proposes the following declaration: void keep_positive (int* array, int num_things); Explain why this declaration cannot serve the intended purpose. Page 3 Name: ____________________________________________ Problem 2 (20 Points): Stacks and Traps in LC-3 Parts A and B of this problem both make use of the CHECK_X function described below....
View Full Document

This note was uploaded on 01/23/2012 for the course ECE 190 taught by Professor Hutchinson during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 13

e2.s04 - ECE 199 Exam II Spring 2004 Tuesday, April 6 th ,...

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