Last active
August 29, 2015 14:19
-
-
Save ryancatalani/574e77c8b657ceccf752 to your computer and use it in GitHub Desktop.
Berkeley Beacon snow day calculator
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 monday_snow_days = 2; // // Days of school canceled on Monday before 4 pm | |
var monday_after_snow_days = 1; // Days of school canceled on Monday after 4 pm | |
var tuesday_snow_days = 2; | |
var wednesday_snow_days = 1; | |
var credit_cost = 1145.0; // http://www.emerson.edu/admission/graduate-admission/tuition-expenses/tuition-cost | |
var credit_hours = 15.0; // 1 credit hour per semester is 15 weeks of classroom instruction; http://www.emerson.edu/policy/credit-hour-definition | |
var credit_cost_per_hour = credit_cost / credit_hours; |
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
// Uses the big.js <http://mikemcl.github.io/big.js/> library, just in case there were large numbers. | |
var calculate_cost = function(hours) { | |
var hours_big = new Big(hours); | |
var rounded = hours_big.times(credit_cost_per_hour_big).round(2, 1).toFixed(2); | |
update_total_text(rounded); | |
total_cost = rounded; | |
update_share_links(); | |
return rounded; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment