http://www.cs.cornell.edu/Info/Courses/Spring-96/CS100/programs/program6.html
There is a built-in function named "fabs" that computes the absolute value function on doubles, which you will probably want to use. There is a function called "abs" as well, but this one has an integer argument.
In the Program 6 folder there is a file called "tests" which describes some additional tests you should run and hand in for Part 2, along with the answers that should be produced.