This script gives you a weighted average and a degree classification based on my interpretation of these rules.
degree-classifier.py <y3grades> <y2grades>
where y3grades
and y2grades
are space-separated lists of grades from your 3rd year and 2nd year, respectively. The lists do not need to be sorted (the script will do it for you), but they must contain 8 integers each.
This script is a casual programming exercise. The output it gives is by no means official and no accuracy or correctness is guaranteed. Do not use it to make any decisions.