Change the user interface of a class hierarchy. All the classes in the Integrator hierarchy from Chapter 9.3 take the integration limits a and b plus the number of integration points n as input to the constructor. The integrate method takes the function to integrate, f(x), as parameter. Another possibility is to feed f(x) to the constructor and let integrate take a, b, and n as parameters. Make this change to the integrate.py file with the Integrator hierarchy. Name of program file: integrate2.py.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here