F[x_]:= 1-(E^(-x))
A = 0;
B = 4;

NMaximize[{Abs[F''[x]],x≥ A,x≤B},{x}]

Clear[n,m,h]

R=1*(B-A)^3/(12*n^2);

e=0.01;

Solve[R==e,n];
a=n/.%;

If[Floor[a[[2]]]==a[[2]],m=a[[2]],m=Floor[a[[2]]]+1];
h=(B-A)/m;

points=Table[A+i*h,{i,0,m}];

sum=0;

Do[sum+=F[points[[i-1]]]+F[points[[i]]],{i,2,m+1}];
sum *= h/2;

N[sum]

NIntegrate[F[x], {x, A,B}]

Integrate[F[x],{x,A, B}]-N[sum]