{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

20099_t2_solution - CSC 108H1 F Question 1 Test 2 Solutions...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 108H1 F 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:
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern