midterm-f08 - EECS 280 Midterm Fall 2008 This is a...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
EECS 280 Fall 2008 1 EECS 280: Midterm Fall 2008 This is a closed-book exam; no notes are allowed. There are 5 problems on 14 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, nor have I concealed any violations of the Honor Code. Signature: _________________________________________ Name: _________________________________________ Uniqname: _________________________________________
Image of page 1

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

View Full Document Right Arrow Icon
Uniqname:________________________________________________________________________________ EECS 280 Fall 2008 2
Image of page 2
Uniqname:________________________________________________________________________________ EECS 280 Fall 2008 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
Image of page 3

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

View Full Document Right Arrow Icon
Uniqname:________________________________________________________________________________ EECS 280 Fall 2008 4 1 String Processing Write the following function: int numWords(const char *s) // REQUIRES: s is a C string // EFFECTS: Returns the number of "words" in s. A "word" is any // sequence of non-space characters at the beginning, // end, or middle of the string // // For example: " the quick brown fox" is four words. // and “four score and... sev3n year’s ago “ is six. // Your function must be iterative. You may use either array subscripting or pointers to access the string. You may assume there will be no “whitespace” characters other than the space: ‘ ‘
Image of page 4
Uniqname:________________________________________________________________________________ EECS 280 Fall 2008 5
Image of page 5

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

View Full Document Right Arrow Icon
Uniqname:________________________________________________________________________________ EECS 280 Fall 2008 6 2 Aggregates and Enumerations You have been tasked to build the software used at Walt Disney World for ticket scanning. Walt Disney World has four different theme parks: enum Park { MAGIC_KINGDOM, EPCOT, HOLLYWOOD_STUDIOS, ANIMAL_KINGDOM }; A ticket entitles a Guest to one or more “days” entry into a theme park. Each Guest has “re- entry” privileges.
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern