How to write code for left hand rule

Find an example of a function f(x) on an interval [a,b] so that the left (or right) rule gives zero error. Show the left/right hand rule computation, computation of the exact value of the integral, the maximum error estimate, and the actual error.