CS115W2009M2

same start end list of string list of string

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: which produces the number of strings in a list of nonempty strings which begin with either “A” or “a”. ;; count-start-Aa: ( list of string ) → num ;; produces the number of strings, in los which begin with either “A” or “a”. ;; example: ( count-start-Aa ) ( list “aBc” “bdf” “Abaaa” ) ) → 2 ( define ( count-start-Aa los ) b) [10 marks ] Create a function lengths which consumes a list of strings and produces a list of numbers, of the same length, containing the lengths, in order, of each string in the original list. ;; lengths: ( list of string ) → ( list of num ) ;; produces list of numbers which contains the lengths of all strings in los ;; example: ( lengths ( list “a” “” “ABC-123” ) ) → ( list 1 0 7 ) ( define ( lengths los ) c) [ 10 marks ] Create a function same-start-end which consumes a list of strings and produces a list of strings from it containing only those strings in which the f...
View Full Document

This note was uploaded on 10/24/2009 for the course CS 115 taught by Professor Graham during the Fall '08 term at Waterloo.

Ask a homework question - tutors are online