-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.min.a.js
3 lines (3 loc) · 1.08 KB
/
calculator.min.a.js
1
2
3
var rate21=50,rateDuo=75,rate23=45,rate24=45,insWSCAC=60,insYouAC=70,insGrnd=60,tow=1.4/100;function hr2min(a){return 60*a}function min2hr(a){return a/60}function divide(a,b){return a/b}document.addEventListener("DOMContentLoaded",function(){document.getElementById("calculButton").addEventListener("click",function(){calculatePrice()})});
function calculatePrice(){var a,b;switch(document.getElementById("airplaneSel").value){case "ASK-21":a=rate21;break;case "DUO-X":a=rateDuo;break;case "ASK-23":a=rate23;break;case "ASW-24":a=rate24;break;default:a=0}b="yes"==document.getElementById("instSel").value&&"Yours"==document.getElementById("airplaneSel").value?70:"ASK-23"==document.getElementById("airplaneSel").value||"ASW-24"==document.getElementById("airplaneSel").value?0:"yes"==document.getElementById("instSel").value?60:0;var c=parseInt(document.getElementById("towHeight").value)*
tow/min2hr(parseInt(document.getElementById("eta").value));a=Math.round(100*(a+b+c))/100;document.getElementById("resultMin").value="$"+Math.round(a/60*100)/100;document.getElementById("resultHour").value="$"+a};