How much energy is stored in the capacitor after 18us?
Current is charge per unit time: \$ I = \frac Q t \$.

Charge is current by time: \$ Q = It \$.




For 0 to 5 &mu;s: Q = 2 &times; (5 - 0).
For 5 to 7 &mu;s: Q = 0.4 &times; (7 - 5).


You should be able to work out the rest. Add them up and you've got the total charge passed into the capacitor. From that you can work out the voltage and the energy.