Grade Distribution
Exercise 1 (ex1) - 20% of the grade
Exercise 2 (ex2) - 25% of the grade
Exercise 3 (ex3) - 25% of the grade
Exam (exam) - 40% of the grade

All three exercises were mandatory to pass the course. If you failed an exercise your grade is considered 0 for that exercise:
m_ex1 = (ex1>=60 ? ex1 : 0)
m_ex2 = (ex2>=60 ? ex2 : 0)
m_ex3 = (ex3>=60 ? ex3 : 0)

Grade Algorithm:
If (did not take exam)
    grade = 260
else if (did not submit all three exercises)
    grade = 250
else
    grade = 0.4 * exam + 0.2 * m_ex1 + 0.25 * m_ex2 + 0.25 * m_ex3
    grade = round(min(100, grade))
end

Hope you did well!!

Lior