Can a machine be ethical? Why teaching AI ethics is a minefield.

Artificial intelligence will soon be powerful enough to operate autonomously, how should we tell it to act? What kind of ethics should we teach it?