Java tutorial
//package com.java2s; public class Main { /** * Computes Defence value given an attribute value * @param indice the attribute value * @return Defence value for the given attribute value */ public static int computeIndiceDefense(final int indice) { return (int) Math.ceil(indice / 2.0 + 1.5 - (indice + 1) / 7 / 2.0); } }