CS 5500 Assignment #1. Assigned: Wednesday, 7 September 2016 Due: Wednesday, 14 September 2016 This assignment serves three purposes. It provides a concrete example of a small specification for a small program, which we can then criticize and discuss. It gives the instructors a small sample of each student's programming style and skill. It also gives students some constructive feedback on their programming. For this assignment, you will write a small program that defines a function or method named serried that satisfies the following informal specification: Given four arguments s, t, n, and f, where s and t are arbitrary strings of arbitrary Unicode characters (i.e. code points excluding surrogates and noncharacters), n is a positive integer, and f is a real number with 0 <= f <= 1, serried(s, t, n, f) returns true if s contains a substring of exactly n characters such that at least f*n of those characters occur within t; otherwise serried(s, t, n, f) returns false. Your program must run on login.ccs.neu.edu using only the programming languages that are already installed for use by students on that Linux machine. You are responsible for ensuring that your program is capable of processing arbitrary strings of arbitrary Unicode characters. You are responsible for writing your own tests of your program. When you submit your program, however, please omit your tests from the submitted program so the grader won't have so much code to read. You will submit your program in printed form, on paper, at the beginning of class on the day this assignment is due. The grader will grade your program by reading it and grading its correctness, readability, and efficiency. Correctness and readability are more important than the efficiency of your program, but you will lose credit if the average-case asymptotic running time of your program is worse than O(|s|+|t|), where |s| is the length of s and |t| is the length of t. To achieve that degree of asymptotic efficiency, the running time of your program must be essentially independent of n and f. -------------------------------------------------- Examples. Suppose the serried function is written in R7RS Scheme, and consider the following test strings: (define s1 "abcde") (define s2 "p\x1d110;q\x1d110;rstuvw") (That second definition means s2 consists of ten characters: the letter p, the musical symbol fermata, the letter q, another musical symbol fermata, and the six letters from r through w. Note that the musical symbol fermata does not lie within Unicode's Basic Multilingual Plane.) Then (serried s1 "aeiou" 5 0.1) evaluates to true. (serried s1 "aeiou" 5 0.5) evaluates to false. (serried s1 "aeiou" 6 0.0) evaluates to false. (serried s2 "qr" 3 0.6) evaluates to true. (serried s2 s1 7 0.0) evaluates to true. (serried s2 s1 7 0.1) evaluates to false. --------------------------------------------------