Electrical and Computer Engineering
14 of 14
UAH
CPE 112
Problem-Solving Case Study:
Finding the Area Under a Curve
•float Funct( /* in */ float x )    // Value to be cubed
•
•// Computes x cubed.  You may replace this function with any
•// single-variable function
•
•// Precondition:
•//     The absolute value of x cubed does not exceed the
•//     machine's maximum float value
•// Postcondition:
•//     Function value == x cubed
•
•{
•    return x * x * x;
•}
•
•