There are 3 judges, 3 rounds and 3 judges in this diving competition.
There is also a degree of difficulty from 1 to 3.5 that multiplies with the added score
Suppose Contestant 1 would go first:
Degree of difficulty = 2
Judge 1 would give 9
Judge 2 would give 5
Judge 3 would give 1
Now the highest and lowest scores are removed max and min (don't ask why)
So the total would be 10 for Contestant1
My programs calculation is - total  = total  + ((score  - max  - min ) * degree);
Can you correct my formula or tell me something else is wrong?