Last active
August 29, 2015 14:04
-
-
Save joyeecheung/7d08c81d4181793e9850 to your computer and use it in GitHub Desktop.
GPA calculator for insysu.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var courses = $("#score-result table tbody tr"); | |
var totalCredit = 0.0, totalProduct = 0.0; | |
courses.each(function(idx, course) { | |
var cells = $(course).children("td"); | |
if (cells[3].textContent !== "公选") { | |
var credit = parseFloat(cells[2].textContent); | |
var score = parseFloat(cells[5].textContent); | |
totalCredit += credit; | |
totalProduct += credit * score; | |
} | |
}); | |
console.log("本学年评定奖学金所用绩点为:" + totalProduct / totalCredit); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment