{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSpartA-KEY-Dec08 - Computer Science Foundation Exam...

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

View Full Document Right Arrow Icon
1 Computer Science Foundation Exam December 19, 2008 Computer Science Section 1A Name: Solution and Grading Criteria SSN: Max Pts Type Passing Threshold Student Score Q1 11 DSN 8 Q2 10 ANL 7 Q3 10 ALG 7 Q4 10 ALG 7 Q5 9 ALG 6 Total 50 35 You must do all 5 problems in this section of the exam. Partial credit cannot be given unless all work is shown and is readable. Be complete, yet concise, and above all be neat . Do your rough work on the last page.
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
2 1 ) (11 points) Recursion Write a recursive function that takes in a string consisting entirely of lowercase letters, an integer representing the length of the string, and a character. Your function should return the number of letters in the first length characters of the string that come strictly before the target, alphabetically. For example, if the string is "computer", the length 8 and the target character is 'p', then the function should return 4 because the four letters in the string of length 8 that come before 'p' alphabetically are 'c', 'o', 'm', and 'e'.
Image of page 2
Image of page 3
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