midf2010 - University of Waterloo Midterm Examination Term:...

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

View Full Document Right Arrow Icon
Term: Fall Year: 2010 Student Name: ______________________________________________________________________ UW Student ID Number: ______________________________________________________________ Course Abbreviation and Number GEN E 121 (Mechatronics C++) Course Title Digital Computation Section(s) 001 Instructor C. Hulls Date of Exam Monday, October 18, 2010 Time Period Start time: 9:00am End time: 11:00am 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 a purses, pencil cases, packsacks Notes: 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. Question Maximum Mark Mark 1. 8 2. 10 3. 17 4. 10 5. 20 6. 20 Total 85 University of Waterloo Midterm Examination
Background image of page 1

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

View Full DocumentRight Arrow Icon
Fall 2010 GenE 121 (C++) Midterm Page 2 of 9 1. Fill in the Blank [8 Marks Total] a. A variable must be _________________ before it can be used in a program. b. The ___ ________ function returns the remainder from floating point division. c. The * , / , and % operators have the same _______ _________. d. The code if ( ______________ ) tests whether the integer b is equal to zero. e. A function that does not return anything has a return type of _________________. f. For an array of integers called x , the code to set the first element to -1 is x[ __ ] = -1; g. The acos function returns the ___________ _________________ in _____ ______________ (units).
Background image of page 2
Fall 2010 GenE 121 (C++) Midterm Page 3 of 9 2. Short Answer [10 Marks Total] What is output by the following code? a.
Background image of page 3

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

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

Page1 / 9

midf2010 - University of Waterloo Midterm Examination Term:...

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