/* ------------------------------------------------------------------- Modular programming MAIN (driver) program ------------------------------------------------------------------- */ #include int main(int argc, char *argv[]) { extern float f(float); // Declare function f extern float RectangleRule(float f(float), float, float, int); // Declare function RectangleRule float a, b, integral; int N; cout << "Enter start of interval: "; cin >> a; cout << "Enter end of interval: "; cin >> b; cout << "Enter N (number of segments): "; cin >> N; integral = RectangleRule(f, a, b, N); // Use RectangleRule !!! cout << "Approximate finite integral = " << integral << "\n"; }