# mp1-sol - if n< 0 then-n else n else if m< 0 then-m...

This preview shows page 1. Sign up to view the full content.

(* CS421 - Summer 2009 * MP1 * * Please keep in mind that there may be more than one * way to solve a problem. *) open Mp1common (* Problem 1 *) let x = 1304 (* Problem 2 *) let y = 4.21 (* Problem 3 *) let square_minus_x z = z * z - x (* Problem 4 *) let square_plus_y z = z *. z +. y (* Problem 5 *) let abs_largest n m = if n > m then
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if n < 0 then -n else n else if m < 0 then -m else m (* Problem 6 *) let greetings name = if name = "Kirill" then print_string "Greetings, Kirill." else print_string ("Hi " ^ name ^ ", welcome to CS421!") (* Problem 7 *) let triple_the_fun f n = f (f (f n))...
View Full Document

## This note was uploaded on 07/01/2009 for the course CS CS421 taught by Professor Kirillmechitov during the Summer '09 term at University of Illinois, Urbana Champaign.

Ask a homework question - tutors are online