(a) By Ohm's law, V=IR, so
R=IV=0.4A12V=30Ω
(b) With the same resistance and the new potential difference,
I=RV=30Ω18V=0.6A
It is worth noticing the check: the potential difference was multiplied by 18/12=1.5, and the current has come out 1.5 times larger too. That is Ohm's law doing exactly what it says — at constant temperature the current is directly proportional to the potential difference.