Simple definite integral calculator
Using the max of two consecutive values is asymmetric.
(I'd simply use the value sampled, avoids the following issue, too:)
For most every "sample" (i), the code computes the value of f() twice (f(prevI)): keep prevF instead  
a double (64 bits in Processing, as in Java) may be a saner type designator than float (32 bits),
especially for "the accumulator" sum.  When the number of summands approaches the number representable by its mantissa, you need a more sophisticated strategy than adding in numbers one by one.
the code multiplies each and every h by step:
don't, instead, multiply sum by step after the loop
(similarly, don't count trips/iterations, compute as (b-a)/step)
consider making step a parameter
(My pet idea would be setting a time limit and adding samples until time is up.
Depending on sampling strategy, keeping track of weights (width of the trapezoids, step) is a challenge.)