>

CS 1323 Honors, Fall 1996

Individual Project 2
Diction Analysis

Due Monday, September 9, 4:29pm
- late papers not accepted -

Ground Rules
• Five projects are described below, a different one for each team member. Team members listed first on their team's roster must do Project 2A; those listed second, Project 2B; and so on.
• In addition to aspects of Haskell discussed in Lessons 1-6 of the Haskell text, you may, if you find it convenient, use the length operator, which delivers the number of elements in the sequence supplied as its argument. You may also use comparison operators (p.17, Haskell text) to compare numbers.
You must not use any other aspects of Haskell not discussed in Lessons 1-6. (Exception: Project 2E requires the use of the escape feature to represent the apostrophe character: '\''.)
• Read the Code of Conduct for ground rules that apply to all projects.
• Re-read the Project Style Guide to learn about new requirements for session transcripts.
What to Hand In (see also: example project solution)
• Turn in a listing of the Haskell script you write for your project, following the required standards.
• Turn in a session transcript in which you show that your function operates correctly on arguments chosen to demonstrate the function's capabilities.
• Explain (handwritten on the transcript) what aspects of the function's behavior are illustrated by each of your choices of demonstration examples.

Project 2A

Define a function called "matchingElements" that delivers a sequence made up of those elements of a sequence supplied as the second argument of the function that are equal to the value supplied as the first argument.

Project 2B

Define a function called "longerThan" that delivers those elements of a sequence of sequences supplied as its second argument whose lengths strictly exceed a number supplied as its first argument.

Project 2C

Define a function called "shorterThan" that delivers those elements of a sequence of sequences supplied as its second argument whose lengths are strictly less than a number supplied as its first argument.

Project 2D

Define a function called "bar" that delivers a string of asterisks. The number of asterisks in the string it delivers must be the same as the number of elements in the sequence supplied as the argument the function.

Project 2E

Define a function called "removePunctuation" that delivers a string like its argument, but containing no periods, commas, question marks, colons, semicolons, parentheses, quotation marks, or apostrophes.