midw2011 - University of Waterloo Midterm Examination Term...

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

View Full Document Right Arrow Icon
Term: Winter Year: 2011 Student Name: ______________________________________________________________________ UW Student ID Number: ______________________________________________________________ Signature: __________________________________________________________________________ Course Abbreviation and Number GEN E 121 (ME C++/RobotC) Course Title Digital Computation Section(s) 001 Instructor C. Hulls Date of Exam Friday, February 18, 2011 Time Period Start time: 8:30am End time: 10:30am Duration of Exam 2 hours Allowed Materials: Writing instruments ONE (8.5x11) formula sheet written on ONE side only Disallowed Materials No electronic devices of ANY kind. No hats or containers such as purses, pencil cases, packsacks Notes: Questions are to be answered using C++ except where indicated as RobotC using You can assume for any programs that any necessary libraries (eg. #include <iostream> ) have been included. All questions will be marked for credit. If you need to make any assumptions to formulate your solution, state your assumptions clearly. If you need extra space to answer a question, use the back of the previous page. Question Maximum Mark Mark 1. 16 2. 10 3. 12 4. 12 5. 20 6. 20 Total 90 University of Waterloo Midterm Examination
Image of page 1

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

View Full Document Right Arrow Icon
Winter 2011 GenE 121 (C++/RobotC) Midterm Page 2 of 8 1. Short Answer [16 Marks Total] a. [10 Marks] Write one line of code to: i. Declare an array of double s of size 5 ii. Set the power for motorA to be 25%. iii. Declare a Boolean variable isEven that is initialized based on whether n is even or not iv. Output the maximum of 3 integers, a , b , c
Image of page 2
Image of page 3
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