sample-midterm - EECS 280: Midterm Fall 2006 This is a...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
EECS 280 Fall 2006 1 EECS 280: Midterm Fall 2006 This is a closed-book exam; no notes are allowed. There are 5 problems on 17 pages. Read the entire exam through before you begin working. Work on those problems you find easiest first. Read each question carefully, and note all that is required of you. Keep your an- swers clear and concise, and state all of your assumptions carefully. Each question has a box for your answer; please put your answers in the boxes provided. You are to abide by the University of Michigan/Engineering honor code. Please sign below to signify that you have kept the honor code pledge. Honor code pledge: I have neither given nor received aid on this exam. Signature: _________________________________________ Name: _________________________________________ Uniqname: _________________________________________
Background image of page 1

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

View Full DocumentRight Arrow Icon
Uniqname:________________________________________________________________________________ EECS 280 Fall 2006 2
Background image of page 2
Uniqname:________________________________________________________________________________ EECS 280 Fall 2006 3 Problem 1 _________ out of 20 Problem 2 _________ out of 20 Problem 3 _________ out of 20 Problem 4 _________ out of 20 Problem 5 _________ out of 20 Total: ________ out of 100
Background image of page 3

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

View Full DocumentRight Arrow Icon
Uniqname:________________________________________________________________________________ EECS 280 Fall 2006 4 1 Test Cases In the following problems, you are given a specification of a function. For each function, supply the requested number of *simple* test cases and the required number of *boundary-condition* test cases. For each test case, you must give a description of (a) the test case, (b) the expected behavior for a correct implementation of the function, and (for boundary cases) (c) why the case is a boundary case. Please give English descriptions of your test cases, in sufficient detail. For full credit, your cases collectively should provide maximum coverage of behavior. For example, consider the following function: int gcd(int x, int y); // EFFECTS: returns the greatest common denominator of x, y One simple test case might be: a) pass 8 and 4 as arguments b) should return 4. Two boundary test cases might be: a) pass 15 and 64 as arguments b) should return 1 c) they are relatively prime - tests termination condition. a) pass 8 and -4 as arguments b) should return 4 c) gcd may not handle negative numbers correctly
Background image of page 4
Uniqname:________________________________________________________________________________ EECS 280 Fall 2006 5 1.a Palindromes isPal takes a C-style string, and determines if it is a palindrome. bool isPal(const char* s);
Background image of page 5

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

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

This note was uploaded on 01/28/2010 for the course EECS 280 taught by Professor Noble during the Spring '08 term at University of Michigan.

Page1 / 17

sample-midterm - EECS 280: Midterm Fall 2006 This is a...

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

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