<?php
// includes/result_calculator.php

function getGrade($score) {
    if ($score >= 75) return ['A1', 'Excellent'];
    if ($score >= 70) return ['B2', 'Very Good'];
    if ($score >= 65) return ['B3', 'Good'];
    if ($score >= 60) return ['C4', 'Credit'];
    if ($score >= 55) return ['C5', 'Credit'];
    if ($score >= 50) return ['C6', 'Credit'];
    if ($score >= 45) return ['D7', 'Pass'];
    if ($score >= 40) return ['E8', 'Pass'];
    return ['F9', 'Fail'];
}
?>