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

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

View Full Document Right Arrow Icon
Page 1 of 10 University of Waterloo Midterm Examination Term: Summer Year: 2010 Student Name:___________________________________________________________ UW Student ID Number:__________________________________________________ Lab Day:___________________________ TA: ___________________________ Course Abbreviation and Number GEN E 121 (Mech C++) Course Title Digital Computation Section(s) 001 Instructor Rajnish Bassi Date of Exam Friday, June 11, 2010 Course Title Start time: 5:00pm End time:7:00pm 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: You can assume for any program that any necessary libraries have been imported All questions will be marked for credit If you need to make any assumption to formulate your solution, state your assumption clearly Question Maximum Marks Marks 1. 9 2. 16 3. 10 4. 20 5. 20 6. 25
Background image of page 1

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

View Full DocumentRight Arrow Icon
Page 2 of 10 1. Arithmetic and Boolean Expressions [9 Marks Total …. 3 marks each] Write the output for the following expressions. a) int main ( ) { int i = 5 ; cout << 5 % 4 + 7 / 3.0 + i++ ; } _____________________________________________________________________ b) int main ( ) { float i = 5.0 ; float j ; j = int (i / 3) ; cout << fixed << setprecision (2) << j ; } _____________________________________________________________________ c) int main ( )
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

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

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

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