ps2 - Problem Set 2: Folding and Datatypes Due 2/12/09...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem Set 2: Folding and Datatypes Due 2/12/09 Instructions This problem set has four parts. You will write your solution to part one in the file folding.ml; you will write your solution to the other three parts in the file lecture.ml. To get you started, we have provided these two stub files. You should download and edit these files. Once you have finished, submit your solution using CMS, linked from the course website. Three important notes about grading: 1. Compile errors: All programs that you submit must compile. Programs that do not compile will probably receive an automatic zero. If you are having trouble getting your assignment to compile, please visit consulting hours. If you run out of time, it is better to comment out the parts that do not compile and hand in a file that compiles, rather than handing in a more complete file that does not compile. 2. Missing functions: We will be using an automatic grading script, so it is crucial that you name your functions and order their arguments according to the problem set instructions, and that you place the functions in the correct files. Otherwise you may not receive credit for a function properly written. 3. Code style: Finally, please pay attention to style. Refer to the CS 3110 style guide and lecture notes. Ugly code that is functionally correct may still lose points. Take the extra time to think out the problems and find the most elegant solutions before coding them up. Part 1: Folding (24 points) Folding is one of the most useful tools in functional programming and you will certainly use it many times over the course of the semester. The following exercises are designed to get you comfortable with folding to do useful computations on lists. Note: All of these functions can be written without folding, but the point of the exercise is to get used to folding, so every function must include either List.fold_left or List.fold_right. Here we introduce type student = int * float * (char option) . Abstraction Function: the int in the tuple represents the student's id number, the float represents the raw numerical score and the char option represents the letter grade. This datatype will be used throughout the problem set. 1.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

ps2 - Problem Set 2: Folding and Datatypes Due 2/12/09...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online