function updateTotal() {
var total;
var TheIndex;
var TheIndex_FoodPlan;
var i;
var total_semester;
var total_year;
var additional_costs;
var InstructionalCost;
total = 0;
if ($("#Deg0").attr('checked') && $("#Res0").attr('checked')) {
$("#TuitionPerHour").val(202.83);
}
if ($("#Deg0").attr('checked') && $("#Res1").attr('checked')) {
$("#TuitionPerHour").val(202.83);
}
if ($("#Deg0").attr('checked') && $("#Res11").attr('checked')) {
$("#TuitionPerHour").val(202.83);
}
if ($("#Deg0").attr('checked') && $("#Res2").attr('checked')) {
$("#TuitionPerHour").val(parseFloat(243.39).toFixed(2));
}
if ($("#Deg0").attr('checked') && $("#Res3").attr('checked')) {
$("#TuitionPerHour").val(parseFloat(304.24).toFixed(2));
}
if ($("#Deg0").attr('checked') && $("#Res4").attr('checked')) {
$("#TuitionPerHour").val(482.83);
}
if ($("#Deg1").attr('checked')) {
$("#TuitionPerHour").val(294.44);
}
if ($("#Deg2").attr('checked')) {
$("#TuitionPerHour").val(580.68);
}
if ($("#Deg3").attr('checked')) {
$("#TuitionPerHour").val(202.83);
}
if ($("#Deg4").attr('checked')) {
$("#TuitionPerHour").val(294.44);
}
total = parseFloat(total + (parseFloat($("#SemesterHours").val()) * parseFloat($("#TuitionPerHour").val())));
$("#TuitionCost").val(total.toFixed(2));
InstructionalCost = total;
total = parseFloat(total + parseFloat($("input[name='Housing']:checked").val()));
/* Add in Health Service fee $40 if there is housing*/
if ($("input[name='Housing']:checked").val() == "0") {
$("#HealthService").val(0);
}
else {
total = parseFloat(total + 47);
$("#HealthService").val(47);
}
/*Add in FoodPlan fee*/
for (i = 0; i < document.CostEst.FoodPlan.length; i++) {
if (document.CostEst.FoodPlan[i].checked) {
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.