final_day1 - ECE 190 Final Exam Monday, May 9th, 2011...

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 190 Final Exam Monday, May 9th, 2011 Problem 1 (5 points): Warmup Problem 2 (20 points): LC-3 Problem 3 (10 points): Debugging Problem 4 (10 points): Linked lists Problem 5 (15 points): Problem Solving Be sure your exam booklet has 9 pages. This is a closed book exam. You are allowed four handwritten 8.5 x 11 sheets of notes. Absolutely no interaction between students is allowed. Dont panic, and good luck! Code must compile in order to receive credit! Students MUST compile their code using the provided make commands. It is highly recommended that you create backups of your code as you develop your solutions. 1 Warmup (5 points) For this problem, you will be implementing the load board function that loads a binary board file into a board data structure. The board file has the following binary format: The number of rows in the board (1 byte) The number of columns in the board (1 byte) The board cell data, one byte per cell The board data structure is just like the data structure you worked with in MP5, except that the cells are chars instead of an enumerated data type (in standard C, a char is 1 byte): typedef struct { int rows ; / * Number of rows in the board * / int cols ; / * Number of columns in the board * / char * c e l l s ; / * Pointer to the board c e l l array (row- major layout ) * / } board ; Implementation Implement the load board function in file.c in the mp directory. To receive any credit for this problem, the code must compile. Testing To test, you must be in the mp directory. Run make to build the program. This will produce a test executable called test load, which when run will test your code. For convenience, you can update the test executable and run it in one go with make test You will also see the input binary board files in the mp directory, labeled level[0-4]. Recall that you can view the contents of a binary file with the hexdump utility: hexdump- C < file name > 2 LC-3 (20 points) Convert the following function from C to LC-3. This function implements searching a sorted binary tree to determine if an element exists within the tree....
View Full Document

Page1 / 8

final_day1 - ECE 190 Final Exam Monday, May 9th, 2011...

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