//expressions used to calculate the weight for each exam and hw assignment. public static double grades(double weightedHomeworkScore, double weightedmid1Score, double weightedfinal2Score) { double weightedHomeworkScore=(score1+score2+score3+(sections*4)/maxPossible1+maxPossible2+maxPossible3+sectionsMax)*homeWeight; return round2(weightedHomeworkScore); double weightedmid1Score=((mid1/100)*mid1Weight); return round2(weightedmid1Score); double weightedfinal2Score=((final2/100)*final2Weight); return round2(weightedfinal2Score); } // Returns the given double value rounded to the nearest hundredth. public static double round2(double number) { return Math.round(number * 100.0) / 100.0; System.out.println("Course grade=" + round2(int grades));
return round2(weightedHomeworkScore);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)