final - CS 177 Fall 2010 Final Exam - There are 50 single...

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

View Full Document Right Arrow Icon
CS 177 Fall 2010 Final Exam ------------------------------------------------------------------------------ 1 There are 50 single choice questions. Each one is worth 4 points. The total score for the exam is 200 points. Answer the questions on the bubble sheet given. Fill in the Instructor , Course , Signature , Test , and Date blanks in the bubble sheet. For “Instructor” put your RECITATION INSTRUCTOR’S LAST NAME given in the table below . For “Course” put CS 177. For “Test/Quiz” put 03 . Fill in the bubbles that correspond to your name, section and Student ID in the bubble sheet. For your section number, use the SECTION NUMBER of your recitation section. Consult the following list: Sec Rec Time Rec Room Rec Instructor 0001 WED 08:30 BRNG 1242 Kazi Mohammad 0002 WED 09:30 LWSN 1106 Ruby Tahboub 0003 WED 10:30 LWSN 1106 Jin Yu 0004 WED 11:30 LWSN B134 Gnana Kiruba Surendra Kumar 0005 WED 14:30 LWSN 1106 Uzunbaz Serkan 0002 FR 07:30 LWSN B134 Ruby Tahboub 0001 FR 08:30 LWSN B134 Kazi Mohammad 0004 FR 11:30 CL50 129 Gnana Kiruba Surendra Kumar 0003 FR 13:30 BRNG 1230 Jin Yu 0005 FR 15:30 LWSN B134 Uzunbaz Serkan 0005 FR 16:30 HAAS G066 Uzunbaz Serkan For your student ID, use the 10 digit ID number on your student ID card. DO NOT USE YOUR SOCIAL SECURITY NUMBER! Exams without names will be graded as zero . Only the answers on the bubble sheet will be counted. The questions will be discarded. Remember to fill in also the fields on page 2.
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 177 Fall 2010 Final Exam ------------------------------------------------------------------------------ 2 Recitation Section Number________________________________ Recitation TA‟s Name________________________________ Student Last Name_________________________________ Student First Name_________________________________
Background image of page 2
CS 177 Fall 2010 Final Exam ------------------------------------------------------------------------------ 3 Q1. Which set of statements given below give the same results? A) print int(1.0/2.0) print 1 / 2 B) print 1 / 2.0 print int(1 / 2.0) C) print 1.0 / 2 print int(1.0 / 2) D )print 1 / 2 print 1 / 2.0 Q2. Given two numbers in binary format a = 010101 , b = 000111 , compute the 2‟s complement of a+b. Which one of the following is the correct answer? A) 100011 B) 100101 C) 100100 D) 100110 Q3. What happens when the following function is executed? def guess_the_function(): i = 0 while 1==1: print "CS177" i = i + 1 if ( i > 10): 1 = 0 A) The function displays CS177 10 times. B) The function displays CS177 11 times. C) The function never enters the while loop. D) The code does not compile due to a syntax error.
Background image of page 3

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

View Full DocumentRight Arrow Icon
CS 177 Fall 2010 Final Exam ------------------------------------------------------------------------------ 4 Q4. A DNA string consists of four characters {A, T, C, G}. Consider the following function: def finalexam2(s): t = s; for i in range(0,len(s)): if (s[i] == 'A'): c = 'T' elif (s[i] == 'T'): c = 'A' elif (s[i] == 'C'): c = 'G' else: c = 'C' if i == 0: t = c + t[1: ]
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/22/2012 for the course CS 177 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 24

final - CS 177 Fall 2010 Final Exam - There are 50 single...

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

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