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

Info iconThis 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.
Background image of page 1

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

View Full DocumentRight 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'. int earlier_letter_count(char* str, int length, char target)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 09/21/2011.

Page1 / 6

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

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