updated script.js

Fixed the calculations for the grade percentage and started formatting
the output