CMSC 331 Principles of Programming Languages
CSEE | 331 | Current | Resources

Project 3

List Manipulation - ML

Back to Homepage

Updates

Updates to the page have been made in Red

Due Date

The project is due by midnight Tuesday, May 13th, meaning 1 minute after 11:59pm on Tuesday, May 13th.

You are allowed to submit your project up to two days late. However, for each day that the project is late, points will subtracted from the score you obtained for the project based on the following table:

Days Late Points Deducted
1 Day 10
2 Days 25
 
The Objective

To gain experience more with ML and functional programming.

Project Description

Using the SML interpreter on linux.gl, write some simple functions. Please put each function in it's own *.sml file (i.e. prob1.sml).

You are allowed to write and use supporting functions in addition to the high level functions which you are to write.

  1. Given a list L, compute its length (ML has a built-in function for this, but you need to "roll your own")
  2. Given a list L, return the next to last item in the list. If list is empty, or has just one element, return the empty list. Again, ML has a nth function to do this, you may not use it.
  3. Given a list L in which each item is an integer, compute the number of even (i.e. evenly divisible by 2) elements.
  4. Given a list L in which each item is an integer, compute the sum of the smallest and largest numbers in the list.
  5. Given a list L = {l1, l2, l3,...,ln} compute the list 2L = {l1, l1, l2, l2, l3, l3,...,ln,ln} i.e. each element in the input list occurs twice in the output list.
  6. Given a list L = {l1, l2, l3,...,ln} and an integer i, compute the list L-i = {l1, l2, l3,..., li-1, li+1,...,ln}, i.e. the list L with the ith element removed. You should assume that the list begins with element one and not zero. So if I were to remove the 3rd element from [1, 2, 3, 4, 5] I would have the list: [1, 2, 4, 5].
Journal

You will maintain an informal journal during the course of your development of the project. Whenever you work on your project enter the date, how long you worked on it and detail what you did. Your journal should include (but is not limited to)...

  1. Brief discussion about your initial design
  2. Description about the development (progress)
  3. Significant Bugs and errors that you ran across
  4. Comment on design changes that you made along the way
  5. Describe any challenges that you may have encountered
Read Me File

You should include a plain text document that directs the grader how to compile and run the project. If there are any special instructions for compilation please detail them here.

Submitting the Program

You are free to develop your project on whatever computers on whatever environment that you wish. However, your program must run on linux[123].gl.umbc.edu using the mentioned SML interpreter. You will be using the UMBC submit program, so you will need to have the program in your GL account in order to submit your project.

To submit the project you will issue the command submit cs331 proj3 <files> where files are your source code files (*.sml), the file that tells the grader how to compile the project (readme.txt) or any other additional information you may want to specify to the grader, and the journal that you wrote while working on the project (journal.txt).

linux1-(09:08pm): submit cs331 proj3 *.sml readme.txt journal.txt Submitting proj3.sml...OK Submitting readme.txt...OK Submitting journal.txt...OK linux1-(09:08pm):

To verify that the files were submitted successfully, use the command submitls cs331 proj3.

linux1-(09:09pm): submitls cs331 proj3 total 29 drwxr-xr-x 2 dhood2 general 2048 Feb 18 21:08 . drwxr-xr-x 135 dhood2 general 6144 Feb 18 21:05 .. -rw-r--r-- 1 dhood2 general 4084 Feb 18 21:08 proj3.sml -rw-r--r-- 1 dhood2 general 46 Feb 18 21:08 journal.txt -rw-r--r-- 1 dhood2 general 46 Feb 18 21:08 readme.txt linux1-(09:09pm):
 
Academic Integrity

Academic misconduct will not be tolerated. Any work that you submit for credit is to be your work. For homework and programming projects, general discussion with your classmates regarding project requirements or the approach to be taken is permitted. The solutions must be yours. Electronic submission of programming assignments will be required, and software that measures similarity between submitted projects will be used. Possible penalties for misconduct will include zero points on that assignment (homework or project), reduction in the final grade for the course, or an "F" in the course.

Any act of dishonesty may be reported to the University's Academic Misconduct Committee for further action. Egregious cases of cheating will be written up as a "more serious" infraction. In this case, you will not be allowed to drop the course. Also, a "more serious" infraction would appear as a permanent part of your student record and would be seen by potential employers when they ask for an official copy of your transcript.

If you aren't sure if a specific action constitutes misconduct, ask your instructor first.

Last Modified: Wednesday, 07-May-2003 14:31:31 EDT