The first question comes from the realisation that the power rating, "9W" represents 9 joules being supplied every second and so can be written as 9J/s and so in 5 minutes (or 300 seconds) the energy supplied is:
9J/s * 300s = 2700J
The second part comes from the equation P=IV and we already have numbers for power and voltage:
9 = 18 * I
I = 9/18 = 0.5Amps