Question: ocaml Write a function that takes a, b, and c and return a string of the tree values in sorted order. You might want to
Write a function that takes a, b, and c and return a string of the tree values in sorted order. You might want to write a function named combine a b c that returns a contact "." b contact : contact c. You will use string_of_int function to convertint to string. sort_as_str 5 4 6;; (* return "4:5:6" *) sort_as_str 4 6 5;; (* return "4:5:6" *) sort_as_str 4 5 6;; (* return "4:5"6" *) Problem 2: Define a function named div with two named parameters. The first is the dividend and the other is the divider The divider is optional, and its default value is 1. div-divider:3 -dividen:12;; (* return 4 *) div-dividen:12 -divider:3;; (* return 4 *) div-dividen:10;; ** return 10 *) . Problem 3: Define the following functions abs a - returns the absolute value of a inca returns a incremented by 1 deca returns b decremented by 1 double a returns a times 2 triple a - returns a times 3 half a - returns a divides by 2 . . Use the concept of pipe and the methods you define above to do the following: Start with the value 5, double the value, triple the result, increment the result by 1. Start with value of -2, double the value, triple the result, increment the result by 1, reduce the result by half, get the absolute value of the result and decrement the result by 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
