20099_t2_solution - CSC108H1F Test 2 — Solutions Fall 2009 Question 1[10 marks For the purpose of this question we will consider the

Info iconThis preview shows pages 1–2. 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 Test 2 — Solutions 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 values for s and i , the expected function result, and the purpose of the test case. All of the test cases should be different from each other, and each should test something significant. You will receive no credit for repetitive test cases. Do not include tests that check for invalid input. Value of s Value of i Expected result Purpose of this test case There are many more than 4 good test cases. Attributes of the inputs that can be varied:There are many more than 4 good test cases....
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 / 4

20099_t2_solution - CSC108H1F Test 2 — Solutions Fall 2009 Question 1[10 marks For the purpose of this question we will consider the

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

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