CSE 3302 Programming Languages

Summer 07

 

Programming project #2 (worth 10% of total grade)

Due July 24th at class time. Turn in the lab by email to the TA. Projects turned in on or July 17th will receive up to 5 points extra credit.

 

Assignment:

 

Use the clisp compiler on omega or gamma and write a Common LISP program to solve the problem below.

 

The problem to solve:

 

Write a set of one or more LISP functions to take in a block of text (an unpunctuated and uncapitalized paragraph in parentheses) and return the following information:

 

a.   A count of the conjunctions (ÒandÓ, ÒbutÓ, ÒorÓ, and ÒnorÓ) in the text

b.   A count of the articles (ÒaÓ, ÒanÓ, and ÒtheÓ) in the text

c.   A count of the total words in the text minus the articles

 

These values should be returned as a list of three values

 

(conjunction_count article_count word_count)

 

Additionally, you should have a function that will create a frequency table for the conjunctions and articles in the input text similar to the example that was done in class on the board. For this part of the program you may use MacLennanÕs code to get started.

 

A sample block of text for input will be posted on the website.

 

You must turn in the following:

      To the TA:

1)             Your source code for the program

2)             A script of the program execution and output – can be interpreter output

      To Dr. T:

3)             A half-page single space write up of what you liked and disliked about using LISP and comparing it to C and C++ (or Java)

 

 

Your program will be graded on the quality of the code and the documentation (35%), the correctness and completeness of the program output (50%), and your write up about using the language (15%)

 

Notes:

There are many online references for LISP. Feel free to use these just make sure to cite them as sources if used for your write up.