gene121_f11

gene121_f11 - Final Examination Term: Fall Year: 2011...

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

View Full Document Right Arrow Icon
Student Name: ______________________________________________________________ Signature: __________________________________________________________________ Student Identification Number: ________________________________ Course Abbreviation and Number: GENE 121 Course Title: Digital Computation Section(s): 001 Instructor(s): C. C. W. Hulls, P.Eng. Date of Exam: Saturday December 10, 2011 Exam Period Start time: 4:00pm End time: 6:30pm Duration of Exam: 2.5 hours Number of Exam Pages: (includes cover page) 12 Exam Type: (select one) Closed Special Open Book Materials Book Materials Allowed: (select one) No additional materials are allowed. Materials allowed are listed below: Exams are printed double sided on white paper. Select this box if second side of paper is to be used for rough work calculations. Notes: No electronic devices including NO CALCULATORS You can assume for any programs that any necessary #include s have been written. If you need to make any assumptions to formulate your solution, state your assumptions clearly. Answer all questions in the space provided. If you require additional space, write on the back of the opposite page and indicate this clearly. Unless specified in the question, you do not need to include error checking. Questions are to be answered using C++ except where indicated as RobotC using If your code is incorrect or incomplete, part marks will be assigned based on any program design shown. Marking Scheme: Question Maximum Score Score 1 11 2 11 3 12 4 16 5 20 6 25 Total 95 Final Examination Term: Fall Year: 2011 ONE 8.5 inch x 11 inch sheet marked on BOTH sides X X X
Background image of page 1

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

View Full DocumentRight Arrow Icon
ID Number: ___________________________ GENE 121 Page 2 of 12 1. Short Answer [11 Marks] (a) [5 Marks] Fill in the blank i. Convert from binary to decimal: 011001 2 = ________________ 10 ii. Convert from hexadecimal to binary: 3E 16 = _____________________________ 2 iii. double d[9]; declares an array of size __________________ iv. SensorType[S1] = sensorCOLORFULL; configures the colour sensor with _________________________________________ LEDs on v. assert( x >= 0 ); stops the program execution when __________________ (b) [1 Mark] What type of software system requires a professional engineer as the designer? (Answer in 25 words or fewer.) (c) [2 Marks] What is shown on the screen after the following code executes: eraseDisplay(); time10[1] = 0; wait1Msec(250); nxtDisplayString(0,"t = %d",time10[1]); (d) [3 Marks] What is output by the following code: int a = 7, b = 4, c = -1; int* p0 = &a; int* p1 = &b; b = *p1 * c; c += *p0; *p0 = c; p0 = &c; *p0 = b + *p1; cout << a << " " << b << " " << c << endl;
Background image of page 2
ID Number: ___________________________ GENE 121 Page 3 of 12 2. Functions [11 Marks] (a) [3 Marks] Write a function that receives the side length of a square-based pyramid and its height, and returns its volume ( ± ² ³ ´ µ ). (b)
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.

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 / 12

gene121_f11 - Final Examination Term: Fall Year: 2011...

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