20099_t2 - CSC108H1F 2009 Test 2 Duration — 35 minutes Aids allowed none Student Number Last Name First Name Lecture Section L0101 Instructor

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: CSC108H1F 2009 Test 2 Duration — 35 minutes Aids allowed: none Student Number: Last Name: First Name: Lecture Section: L0101 Instructor: Horton Do not turn this page until you have received the signal to start. (Please fill out the identification section above, write your name on the back of the test , and read the instructions below.) Good Luck! This midterm consists of 2 questions on 8 pages (including this one). When you receive the signal to start, please make sure that your copy is complete. Comments and docstrings are not required except where indicated, although they may help us mark your answers. They may also get you part marks if you can’t figure out how to write the code. No error checking is required: assume all user input and all argument values are valid. If you use any space for rough work, indicate clearly what you want marked. # 1: /10 # 2: /10 TOTAL : /20 Total Pages = 8 Page 1 cont’d . . . CSC108H1F Test 2 Fall 2009 Question 1. [10 marks] For the purpose of this question, we will consider the letters“a”, “e”, “i”, “o” and “u” (whether lowercase or uppercase) to be vowels, but not ”y”. Part (a) [4 marks] Consider the following function: def vowels(s, i): ’’’Return the length of the longest sequence of consecutive vowels within s that starts at index i. s is a str of length at least one, and i is a valid index into s.’’’ Complete the table below by adding four distinct test cases for function vowels . For each, provide specific....
View Full Document

This note was uploaded on 09/19/2011 for the course CSC 108 taught by Professor Gries during the Fall '08 term at University of Toronto- Toronto.

Page1 / 8

20099_t2 - CSC108H1F 2009 Test 2 Duration — 35 minutes Aids allowed none Student Number Last Name First Name Lecture Section L0101 Instructor

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