@Test public void test1() { assertEquals(98.66f, ScoreCalculator.calculateScore(208, 200), 0.01f); }
public static float calculateScore(int value, int benchmark) { if (value <= benchmark) { return 100f; } else if (value <= 4f * benchmark) { return (((-1f / (3f * benchmark)) * value) + (4f / 3f)) * 100f; } else { return 0; } }
ScoreCalculator { public static float calculateScore(int value, int benchmark) { if (value <= benchmark) { return 100f; } else if (value <= 4f * benchmark) { return (((-1f / (3f * benchmark)) * value) + (4f / 3f)) * 100f; } else { return 0; } } }
ScoreCalculator { public static float calculateScore(int value, int benchmark) { if (value <= benchmark) { return 100f; } else if (value <= 4f * benchmark) { return (((-1f / (3f * benchmark)) * value) + (4f / 3f)) * 100f; } else { return 0; } }  }
ScoreCalculator { public static float calculateScore(int value, int benchmark) { if (value <= benchmark) { return 100f; } else if (value <= 4f * benchmark) { return (((-1f / (3f * benchmark)) * value) + (4f / 3f)) * 100f; } else { return 0; } }  static float calculateScore(int value, int benchmark); }
ScoreCalculator { public static float calculateScore(int value, int benchmark) { if (value <= benchmark) { return 100f; } else if (value <= 4f * benchmark) { return (((-1f / (3f * benchmark)) * value) + (4f / 3f)) * 100f; } else { return 0; } }  static float calculateScore(int value, int benchmark);  }