midf2010

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

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

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

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

View Full Document
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).
Fall 2010 GenE 121 (C++) Midterm Page 3 of 9 2. Short Answer [10 Marks Total] What is output by the following code? a.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/01/2012 for the course GENE 121 taught by Professor Smucker during the Winter '11 term at Waterloo.

### 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
Ask a homework question - tutors are online