1.       Write a function which implements the bisection method for solving real functions.  The input parameters will be

·         a double, the lower bound

·         a double, the upper bound

·         the function, call it f

Note that it will be considered bad input if the sign of f evaluated at the lower bound and the sign of f evaluated at the upper bound are the same.  Also note that you will be testing if f evaluated at the endpoint and f evaluated at the midpoint are the same (if so change the endpoint to the midpoint).

2.        

a.       Use malloc and a pointer to obtain an array of 20 doubles without actually declaring an array. Test your memory allocation by generating 20 doubles between 0 and 1 and storing them in your array.  Print them out to exactly 3 decimal places by cout.

b.      Same assignment as part a, but use “new” instead of malloc.