Drill

ProblemsC# › production

Overall equipment effectiveness

mediumproductionMathC#

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

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

C# needs a compiler and Drill does not host one yet, so this page is the reference rather than an exercise: the problem, worked examples, and the solution in full. To type it out, the same problem runs in Python.

Solve it in Python →

Where you start

public int OeeScore(int availability, int performance, int 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 C#
public int OeeScore(int availability, int performance, int quality) {
    int a = Math.Max(0, Math.Min(100, availability));
    int p = Math.Max(0, Math.Min(100, performance));
    int qy = Math.Max(0, Math.Min(100, quality));
    return (a * p * qy + 5000) / 10000;
}

The same problem in another language

More production problems in C#