Functions and recursive functions.

Place your order now for a similar assignment and have exceptional work written by our team of experts, At affordable rates

For This or a Similar Paper Click To Order Now

Problem 1: Functions and recursive functions. Part 1. Write a function c2f that takes a float as Celsius temperature and returns a float as Fahrenheit temperature. val c2f : float->float = Part 2: Write a function that uses c2f to print a table of Celsius to Fahrenheit. The first argument is the stop temperature, and the second argument is the increment. val c2f_table : float -> float _> unit = For example, if the stop is 100.0 and the increment is 20.0, then it will display: 0.00 32.00 20.00 68.00 40.00 104.00 60.00 140.00 80.00 176.00 100.00 212.00 problem 2 List and pattern matching Part 1: Write a function contains that takes an input as target and a list and returns true if the target is in the list. part 2: write a function that takes a list and returns a list of unique values. For example, if the input is [1;1;2;2;3;4;5;5], then the output is [1;2;3;4;5]. val uniq: ‘a list -> ‘a list = problem 3 Variants Define type of variants of circle, square, rectangle. a circle is defined by its radius a square is defined by the width of its side. a rectangle is defined by the height and width. Write a function is_same that would take two shapes and return true if they are of the same type of shape and have the same area. val is_same : shape -> shape -> bool = problem 4 Trees Part 1: Write a function min_three that returns the smallest input of three input. val min_tree : ‘a -> ‘a -> ‘a -> ‘a = part2: Write a function that takes a tree and returns the smallest value in the tree. You will probably want to use the function in part 1 to help with writing this function. If the tree is empty, raise a Failure exception with the message “tree is empty.” Do NOT assume the tree is a binary search tree. val min_value : ‘a tree -> ‘a = For example, the smallest value in the tree below is 0. 1 / 2 0 / / 1 3 6 1

For This or a Similar Paper Click To Order Now


Calculate the price of your paper

Total price:$26
Our features

We've got everything to become your favourite writing service

Need a better grade?
We've got you covered.

Order your paper