score = (x) -> if x == "Yes" 10 else 0 weights = [0.2, 0.2, 0.2, 0.2, 0.2] air_pollutants = [reduction_evidence, management_and_monitoring, pollutants_reporting, time_bound_targets, target_reporting] weights.reduce((weighted_sum, weight, index) -> weighted_sum + weight*score(air_pollutants[index]) , 0)