got-word?
that consumes a list of words
and a word and produces true if the given word occurs at least once
in the list.
char-count
that consumes a string of length 1 and a string of any length and produces a number indicating how many times the first string appears in the second string. You'll need it for problems 4-6.
num-words-with-letter
that consumes a list of words and a letter (i.e. a string of length 1), and produces a number. The function
produces the number of words in the list that contain at least one occurrence of the given letter.
words-with-two
that consumes a list of words
and a letter and produces a list of all the words
that contain exactly two occurrences of the given letter.
score-words
that consumes a list
of words and produces the score for that list of words according to the
following criteria:
words are scored by giving one point each per letter, except "z", "q", or "x",
which are worth 5 points each.
count-occurrences
that consumes
a list of words and a word and counts the
number of occurrences of the given word in the list.
;; list-to-fbs: list-of-words -> fbs ;; consumes a list of words and produces an fbs that records the number of ;; times the words "fizzle", "bump", and "splat" appear in the list.Here are some test cases you can use to test your function:
(check-expect (list-to-fbs empty) (make-fbs 0 0 0)) (check-expect (list-to-fbs (cons "bump" (cons "bump" (cons "fizzle" empty)))) (make-fbs 1 2 0)) (check-expect (list-to-fbs (cons "splat" (cons "drip" empty))) (make-fbs 0 0 1))
Using web-based turnin, turn in a single file containing all code and documentation for this assignment. Name your file according to the naming conventions for files. Put both partners' names and wpi login names in a comment at the top of the file.