Drill

ProblemsJavaScript › production

Overall equipment effectiveness

mediumproductionJavaScript

OEE multiplies three percentages together into one number that plant managers compare across lines.

oeeScore(availability: int, performance: int, quality: int) → int

Solve it in the editor →

Where you start

function oeeScore(availability, performance, quality) {
  
}

Worked examples

CallResult
oeeScore(90, 95, 99)85
oeeScore(100, 100, 100)100
oeeScore(0, 100, 100)0
oeeScore(150, 100, 100)100

Hint

Clamp all three first, then multiply and divide by 10000 — adding 5000 before the divide rounds it.

Reference solution in JavaScript
function oeeScore(availability, performance, quality) {
  const c = (v) => Math.max(0, Math.min(100, v));
  const n = c(availability) * c(performance) * c(quality);
  return Math.floor((n + 5000) / 10000);
}

The same problem in another language

More production problems in JavaScript