The first thing the computer would need to know is the difference between moral and ethical.
Moral is based on that which maximizes the group entity. Because moral law maximizes the group, it may not always maximize each individual. This second maximization (inidividual) is where ethics comes in. For example, thou shall not steal is a moral law. This moral law could help maximize the group, since the amount of resources and time spent that is spent on defensive measures against stealing would be zero, making more resources available for other things. There is no need for locks, passwords, security systems, etc.,which saves the group money and time.
Although this moral law might help maximize the entity called the group, ethics is less about the group, and more about the needs of the individual or a subset of the group, such as a special interest group. For example, in the above, the united union of theives and pickpockets would not benefit by this moral law. It would create hardship for those people whose natural skill and livelihood involves stealing.
An ethical decision in this case, will yry to create a loop hole in the moral law, which balances the group while also trying to maximizes this special interest group via individual maximization. The ehtical law might allow stealing once every other week. The group is no longer maximized, since this will create a social cost due to defensive measures. But it wll help some people. The result will be an increase in social costs.
In a moral culture, with intelligent and well thought out moral laws, the group can become so efficient and maximized that there is often a surplus in resources. This allows resources to become earmarked for ethical decisions that can benefit individuals and special interests groups. As long as the moral is greater than the ethical, the equation is OK. But if ethical becomes greater than moral, social cost begin to sky rocket.
The computer would be good at finding the sweet spot. Whereas moral often needs to be logical to maximize the entire group, ethical choices are often all about marketing and emotional appeal. Making such a decision would be a different program. it is less about the ehtical law as the ability to market and sell.
Let me give an example. We will start with the moral law, thou shall not steal. A good ethical marketing, to isome individuals ethical gain value from the moral surplus, is the hypothetical; say a man was very hungry and needed to feed his starving family, would it be ethical to steal?
You might say yes, under the conditons of extreme hunger. It is not moral (group maximize) but it is a good ethical (slight cost). The defense lawyers can then use that as the starting point to argue, that this man, who was caught stealing, was very hungry (he hadn't eaten in over two hours). The current law says "very hungry in nebulous terms". This aledged normally likes to eat ten times a day. We have experts that can confirm he was indeed very hungry so it was ethical.
The social cost of the initial good ethical decision, starts to increase as the loophole becomes larger. Lawyers have an ethical duty to defend everyone(translated; get both their share of the moral surplus). The moral might try to get a sphincter on the loophole, by getting moral.
The computer needs all these variables.