Friday, 2 October 2015
LINEAR EQUATION SOLVER CODE


-----------------------------------------------------------------------------------------------------------------
COPY AND PASTE BELOW CODE IN POST HTML SECTION
-----------------------------------------------------------------------------------------------------------------
<html>
<head>
<style type="text/css">
.CalcTable {
padding: 4px 6px;
border: solid #ddd 1px;
border-collapse: collapse
}
.CalcTitleCell {
background-color: transparent;
color: #1d487e;
font-family: Verdana, Arial, sans-serif;
font-size: 130%;
font-weight: bold;
text-align: center;
height: 30px
}
.CalcInstructCell {
padding: 5px;
border-bottom: solid #ddd 1px
}
.CalcRowTitleCell {
background-color: #ccc;
color: #1d487e;
font-family: Verdana, Arial, sans-serif;
font-size: 85%;
font-weight: bold;
text-align: left;
border: solid #ddd 1px
}
.CalcColCell {
background-color: #1d487e;
color: #fff;
font-family: Verdana, Arial, sans-serif;
font-size: 100%;
font-weight: bold;
text-align: center;
border: solid #ddd 1px
}
.CalcColCellLeft {
background-color: #1d487e;
color: #fff;
font-family: Verdana, Arial, sans-serif;
font-size: 100%;
font-weight: bold;
text-align: left;
padding-left: 5px;
border: solid #ddd 1px
}
.CalcColCellRight {
background-color: #1d487e;
color: #fff;
font-family: Verdana, Arial, sans-serif;
font-size: 100%;
font-weight: bold;
text-align: right;
border: solid #ddd 1px
}
.CalcRowOdd {
background-color: #eee
}
.CalcRowEven {
background-color: #fff
}
.CalcInDescCell {
padding-left: 5px;
padding-right: 5px
}
.CalcOutDescCell {
text-align: left
}
.CalcInFldCell {
text-align: right;
padding-right: 5px;
font-size: 8pt
}
.CalcOutFldCell {
text-align: right;
padding-right: 5px;
border-left: solid #ddd 1px;
border-right: solid #ddd 1px;
font-size: 8pt
}
.CalcInFld {
font-size: 8pt
}
.CalcInFldFix {
font-size: 8pt
}
.CalcSelectFix {
font-size: 8pt
}
.CalcOutFldOddFix {
border: medium none;
background-color: #eee;
font-weight: normal;
text-align: right;
font-size: 8pt
}
.CalcOutFldEvenFix {
border: medium none;
background-color: #fff;
font-weight: normal;
text-align: right;
font-size: 8pt
}
.CalcOutFldOdd {
border: medium none;
background-color: #eee;
font-weight: normal;
text-align: right;
font-size: 8pt
}
.CalcOutFldEven {
border: medium none;
background-color: #fff;
font-weight: normal;
text-align: right;
font-size: 8pt
}
.CalcOutFldBoldOdd {
border: medium none;
background-color: #eee;
font-weight: bold;
text-align: right;
font-size: 8pt
}
.CalcOutFldBoldEven {
border: medium none;
background-color: #fff;
font-weight: bold;
text-align: right;
font-size: 8pt
}
.CalcButtonCell {
text-align: center;
border: solid #ddd 1px
}
.CalcButton {}.CalcSummaryCell {
padding-left: 5px;
padding-right: 5px;
background-color: #fff;
border: solid #ddd 1px
}
.ChartTable {
border-collapse: collapse
}
.ChartBody {}.ChartColHead1 {
background-color: #1d487e;
color: #fff;
font-family: Verdana, Arial, sans-serif;
font-size: 100%;
font-weight: bold;
text-align: center;
border: solid #ccc 1px
}
.ChartColHead1Small {
background-color: #1d487e;
color: #fff;
font-family: Arial, sans-serif;
font-size: 80%;
font-weight: bold;
text-align: center;
border: solid #ccc 1px
}
.ChartColHead2 {
background-color: #ccc;
color: #1d487e;
font-family: Verdana, Arial, sans-serif;
font-size: 85%;
font-weight: bold;
text-align: center;
border: solid #ddd 1px
}
.ChartRowOdd {
background-color: #eee
}
.ChartRowEven {
background-color: #fff
}
.ChartTextCell {
text-align: center;
padding-left: 2px;
padding-right: 2px;
border: solid #ddd 1px
}
.ChartTextCellLeft {
text-align: left;
padding-left: 2px;
padding-right: 2px;
border: solid #ddd 1px
}
.ChartNumCell {
text-align: right;
padding-left: 2px;
padding-right: 2px;
border: solid #ddd 1px
}
.ChartNumCellSmall {
font-family: Arial, sans-serif;
font-size: 85%;
text-align: right;
padding-left: 2px;
padding-right: 2px;
border: solid #ddd 1px
}
.ChartSubCell {
text-align: right;
border-top: solid #000 2px;
border-left: solid #ddd 1px;
border-right: solid #ddd 1px;
font-weight: bold;
background-color: #ccc;
padding-left: 4px;
padding-right: 2px
}
.ChartTotCell {
text-align: right;
border-top: double #000 3px;
border-bottom: double #000 3px;
border-left: solid #ddd 1px;
border-right: solid #ddd 1px;
font-weight: bold;
background-color: #ccc;
padding-left: 4px;
padding-right: 2px
}
#dhtmltooltip {
position: absolute;
left: -300px;
width: 150px;
border: 1px solid #000;
padding: 2px;
background-color: #ffffe0;
visibility: hidden;
z-index: 100;
filter: progid: DXImageTransform.Microsoft.Shadow(color=gray, direction=135)
}
#dhtmlpointer {
position: absolute;
left: -300px;
z-index: 101;
visibility: hidden
}
.div_help {
font-family: arial, verdana, helvetica, sans-serif;
font-size: small;
text-align: left;
padding: 10px
}
.SideCalcTitleCell {
font-size: 100%;
background-color: #000;
font-weight: bold;
color: #fff
}
.SideCalcResult {
text-align: right;
width: 94%;
background-color: #eee;
border: solid #000 1px;
font-family: arial, sans-serif;
font-size: 11pt;
color: #000;
padding-right: 5px
}
.SideCalcNum {
font-weight: bold;
width: 30px
}
.SideCalcSign {
font-weight: bold;
color: #00f;
width: 30px
}
.SideCalcClr {
font-weight: bold;
width: 30px;
color: red
}
.SideCalcClrTape {
font-weight: bold;
width: 94%;
color: #000
}
.SideCalcTapeCell {
text-align: center;
background-color: #ccc;
border-top: solid #ccc 1px;
border-left: solid #ccc 1px;
border-right: solid #ccc 1px;
border-bottom: dashed #000 1px;
font-family: courier, arial, sans-serif;
font-size: 10pt;
color: #000;
padding-right: 0px;
padding-left: 0px
}
.BelowCalcTable {
border-collapse: collapse
}
.BelowCalcAdCell {}.BelowCalcColHead {
background-color: #ccc;
color: #1d487e;
font-family: Verdana, Arial, sans-serif;
font-size: 85%;
font-weight: bold;
text-align: center;
border: solid #ccc 1px
}
.BelowCalcImgHead {
background-color: #ccc;
text-align: center;
border: solid #ccc 1px
}
.BelowCalcLinkCell {
text-align: left;
padding-left: 2px;
padding-right: 2px;
border: solid #ddd 1px
}
.sppTable {
width: 300px;
border-collapse: collapse
}
.sppRow {
background-color: #ddd
}
.sppColHead {
background-color: #fff;
color: #1d487e;
font-family: Verdana, Arial, sans-serif;
font-size: 85%;
font-weight: bold;
text-align: center;
width: 240px;
border-left: solid #8f8fb3 1px;
border-top: solid #8f8fb3 1px
}
.sppImgHead {
background-color: #fff;
text-align: center;
width: 60px;
border-right: solid #8f8fb3 1px;
border-top: solid #8f8fb3 1px
}
.sppLinkCell {
font-size: 85%;
text-align: left;
padding-left: 2px;
padding-right: 2px;
border-left: solid #8f8fb3 1px;
border-bottom: solid #8f8fb3 1px;
border-right: solid #8f8fb3 1px
}
.fb_like_button {
border: 1px dotted #000;
background-color: #eee;
padding: 10px;
width: 320px;
float: right
}
.blogItItem {
margin: 18px 0;
padding: 0 12px;
border: 1px solid #ccc;
background: #eee;
box-shadow: 4px 4px 4px #ccc
}
.blogItItem h6 {
font-style: normal;
font-weight: normal;
font-size: 80%
}
.leftnav_heading {
text-align: center
}
.leftnav_heading a {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
text-align: left;
line-height: 14px;
background-image: url();
color: #333;
text-decoration: none;
width: 169px;
height: 41px;
display: block;
font-weight: bold;
margin-top: 18px
}
.leftnav_heading a:hover {
background-image: url()
}
.leftnav_heading span {
display: block;
padding: 7px
}
.texttop {
font-size: 15px;
line-height: 14px;
color: #333;
text-shadow: 0px 0px 2px #fff;
margin-bottom: 10px
}
.textbottom {
color: #333;
font-size: 15px;
text-shadow: 0px 0px 2px #fff
}
#mobileBtnDiv {
display: none
}
@media only screen and (max-device-width: 640px) {
#mobileBtnDiv {
display: block;
width: 100%;
text-align: center;
padding: 10px
}
#mobileBtn {
display: inline-block;
text-align: center;
width: 50%;
font-size: 2em;
line-height: 2em;
background-color: #0f5378;
color: #fff;
text-decoration: none;
border-radius: 10px;
border: 1px solid #fff
}
#mobileBtn:hover {
background-color: #4cc2ce;
color: #087197
}
}
</style>
<script>
var mod_pagespeed_fhLIhm5NFj = "var var_ar=new Array(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\");var var_ar_caps=new Array(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\");function get_samp(form){var samps_idx=document.calc.samps.selectedIndex;var samps_txt=document.calc.samps.options[samps_idx].text;if(samps_txt.indexOf(\"---\")>-1){document.calc.equation.value=\"\";}else{document.calc.equation.value=samps_txt;}\nclear_results(document.calc);}\nfunction solve_equation(form){var v_equation=document.calc.equation.value;var v_variable=\"\";var var_match_cnt=0;var l_paren_cnt=0;var r_paren_cnt=0;var equal_cnt=0;for(var i=0;i<var_ar.length;i++){if(v_equation.indexOf(var_ar[i])>-1){v_variable=var_ar[i];var_match_cnt+=1;}\nif(v_equation.indexOf(var_ar_caps[i])>-1){v_variable=var_ar_caps[i];var_match_cnt+=1;}}\nfor(var i=0;i<v_equation.length;i++){if(v_equation.charAt(i)==\"(\"){l_paren_cnt+=1;}\nif(v_equation.charAt(i)==\")\"){r_paren_cnt+=1;}\nif(v_equation.charAt(i)==\"=\"){equal_cnt+=1;}}\nif(v_equation.length==0){alert(\"Please enter a linear equation.\");document.calc.equation.focus();}else\nif(v_equation.indexOf(\" \")>-1){alert(\"Please remove spaces from the entered linear equation.\");document.calc.equation.focus();}else\nif(var_match_cnt==0){alert(\"Please add a variable in the entered linear equation.\");document.calc.equation.focus();}else\nif(var_match_cnt>1){alert(\"Only one variable is allowed in the entered linear equation.\");document.calc.equation.focus();}else\nif(l_paren_cnt!=r_paren_cnt){alert(\"You have an odd number of parenthesis in the entered linear equation. Please correct.\");document.calc.equation.focus();}else\nif(equal_cnt!=1){alert(\"You must have one and only one equal sign. Please correct.\");document.calc.equation.focus();}else{var tbl=\"<br /><br /><center><table class='ChartTable'>\";tbl+=\"<tr><td colspan='2' class='ChartTextCellLeft'>\";tbl+=\"<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHSLSkgqRY3PY_iFXdVxZzoPMK12-GxS8IPLF3nONJTGil5Q6QndcuvQRCPGPByHYCMcgl3VSzfR0qAkMJvnpaz6V-xzGJNDWC00aZY3aPNIIPzoesvPpp_qVyIrdLbs69xt8kNPaco3ZR/s72-c/BASIC+JAVA+CALCULATOR.png' width='60' height='54' class='ItemLeft' />\";tbl+=\"Please check my work to make sure the result does solve the equation. Substitute the \";tbl+=\"result for the variable (\"+v_variable+\") to make sure my calculations are correct.\";tbl+=\"</td></tr>\";tbl+=\"<tr><td width='200' class='ChartTextCellLeft'>Equation: </td>\";tbl+=\"<td width='350' class='ChartTextCell'>\"+v_equation+\"</td></tr>\";var l_frac_idx_ar=new Array();var l_frac_typ_ar=new Array();var l_frac_num_ar=new Array();var l_frac_den_ar=new Array();var r_frac_idx_ar=new Array();var r_frac_typ_ar=new Array();var r_frac_num_ar=new Array();var r_frac_den_ar=new Array();var lcm_ar=new Array();var l_dec_ar=new Array();var l_dec_typ_ar=new Array();var r_dec_ar=new Array();var r_dec_typ_ar=new Array();if(v_equation.indexOf(\"(\")>-1){var num_pars=1;var pars_cnt=0;while(num_pars>0&&pars_cnt<10){pars_cnt+=1;if(v_equation.indexOf(\"(\")>-1){var l_par_pos=v_equation.indexOf(\"(\");var r_par_pos=v_equation.indexOf(\")\");var dist_equat=v_equation.substring(l_par_pos+1,r_par_pos);var dist_pos=0;for(var i=l_par_pos;i>-1;i--){if(v_equation.charAt(i)==\"=\"||v_equation.charAt(i)==\"+\"||v_equation.charAt(i)==\"-\"){if(v_equation.charAt(i)==\"=\"){dist_pos=i+1;break;}else{dist_pos=i;break;}}}\nvar dist_num=v_equation.substring(dist_pos,l_par_pos);var dist_split_pos=0;if(dist_equat.indexOf(\"+\")>-1){dist_split_pos=dist_equat.indexOf(\"+\");}else{dist_split_pos=dist_equat.lastIndexOf(\"-\");}\ndist_1=dist_equat.substring(0,dist_split_pos);dist_2=dist_equat.substring(dist_split_pos,dist_equat.length);var dist_1_var=0;var dist_1_num=0;if(dist_1.indexOf(v_variable)>-1){dist_1=dist_1.substring(0,dist_1.length-1);if(dist_1==\"\"||dist_1==\"+\"||dist_1==\"-\"){dist_1+=\"1\";}\ndist_1_var=1;}\ndist_1_num=dist_1;var dist_2_var=0;var dist_2_num=0;if(dist_2.indexOf(v_variable)>-1){dist_2=dist_2.substring(0,dist_2.length-1);if(dist_2==\"\"||dist_2==\"+\"||dist_2==\"-\"){dist_2+=\"1\";}\ndist_2_var=1;}\ndist_2_num=dist_2;if(dist_num.indexOf(\"/\")>-1||dist_1_num.indexOf(\"/\")>-1||dist_2_num.indexOf(\"/\")>-1){if(dist_num.indexOf(\"/\")>-1){var dist_frac_ar=dist_num.split(\"/\");var dist_frac_num=dist_frac_ar[0];var dist_frac_den=dist_frac_ar[1];}else{var dist_frac_num=dist_num;var dist_frac_den=1;}\nif(dist_1_num.indexOf(\"/\")>-1){var dist_frac_1_ar=dist_1_num.split(\"/\");var dist_frac_1_num=dist_frac_1_ar[0];var dist_frac_1_den=dist_frac_1_ar[1];}else{var dist_frac_1_num=dist_1_num;var dist_frac_1_den=1;}\nif(dist_2_num.indexOf(\"/\")>-1){var dist_frac_2_ar=dist_2_num.split(\"/\");var dist_frac_2_num=dist_frac_2_ar[0];var dist_frac_2_den=dist_frac_2_ar[1];}else{var dist_frac_2_num=dist_2_num;var dist_frac_2_den=1;}\nvar dist_1_num_final=dist_frac_num*dist_frac_1_num;var dist_2_num_final=dist_frac_num*dist_frac_2_num;var dist_1_den_final=dist_frac_den*dist_frac_1_den;var dist_2_den_final=dist_frac_den*dist_frac_2_den;var dist_1_fnl=dist_1_num_final+\"/\"+dist_1_den_final;var dist_2_fnl=dist_2_num_final+\"/\"+dist_2_den_final;}else{var dist_1_fnl=\"\"+(dist_num*dist_1_num)+\"\";var dist_2_fnl=\"\"+(dist_num*dist_2_num)+\"\";}\nvar dist_insert=\"\";if(dist_1_fnl.indexOf(\"-\")==-1){dist_insert+=\"+\";}\ndist_insert+=\"\"+dist_1_fnl+\"\";if(dist_1_var==1){dist_insert+=\"\"+v_variable+\"\";}\nif(dist_2_fnl.indexOf(\"-\")==-1){dist_insert+=\"+\";}\ndist_insert+=\"\"+dist_2_fnl+\"\";if(dist_2_var==1){dist_insert+=\"\"+v_variable+\"\";}\nv_equation=v_equation.substring(0,dist_pos)+\"\"+dist_insert+\"\"+v_equation.substring(r_par_pos+1,v_equation.length);if(v_equation.charAt(0)==\"+\"){v_equation=v_equation.substring(1,v_equation.length);}}else{num_pars=0;}}\nif(v_equation.charAt(v_equation.indexOf(\"=\")+1)==\"+\"){v_equation=v_equation.substring(0,v_equation.indexOf(\"=\")+1)+\"\"+v_equation.substring(v_equation.indexOf(\"=\")+2,v_equation.length);}\ntbl+=\"<tr><td class='ChartTextCellLeft'>After removing parenthesis using distributive property: </td>\";tbl+=\"<td class='ChartTextCell'>\"+v_equation+\"</td></tr>\";}\nvar sides_ar=v_equation.split(\"=\");var l_len=sides_ar[0].length;var l_sign_pos_str=l_len;var l_sign_str=l_len;for(var i=0;i<l_len;i++){if(sides_ar[0].substring(i,i+1)==\"+\"){l_sign_pos_str+=\"|\"+i;l_sign_str+=\"|+\";}else\nif(sides_ar[0].substring(i,i+1)==\"-\"){l_sign_pos_str+=\"|\"+i;l_sign_str+=\"|-\";}else{if(i==0){l_sign_pos_str+=\"|0\";l_sign_str+=\"|+\";}}}\nl_sign_pos_ar=l_sign_pos_str.split(\"|\");l_sign_ar=l_sign_str.split(\"|\");l_term_list=\"\";var l_term_ar=new Array();var r_term_ar=new Array();var equal_sign_chk=0;var term=\"\";for(s=1;s<l_sign_pos_ar.length;s++){term=sides_ar[0].substring(l_sign_pos_ar[s],l_sign_pos_ar[s+1]);dec_term=term;l_term_ar.push(term);if(v_equation.indexOf(\"/\")>-1){l_frac_idx_ar.push(l_term_ar.length-1);if(term.indexOf(\"/\")>-1){if(term.indexOf(v_variable)>-1){term=term.substring(0,term.length-1);l_frac_typ_ar.push(1);}else{l_frac_typ_ar.push(0);}\nvar frac_ar=term.split(\"/\");lcm_ar.push(frac_ar[1]);l_frac_num_ar.push(frac_ar[0]);l_frac_den_ar.push(frac_ar[1]);}else{if(term.indexOf(v_variable)>-1){term=term.substring(0,term.length-1);l_frac_typ_ar.push(1);}else{l_frac_typ_ar.push(0);}\nlcm_ar.push(1);l_frac_num_ar.push(term);l_frac_den_ar.push(1);}}\nif(v_equation.indexOf(\".\")>-1){if(dec_term.indexOf(v_variable)>-1){dec_term=dec_term.substring(0,dec_term.length-1);l_dec_typ_ar.push(1);}else{l_dec_typ_ar.push(0);}\nl_dec_ar.push(dec_term);}}\nvar r_len=sides_ar[1].length;var r_sign_pos_str=r_len;var r_sign_str=r_len;for(var i=0;i<r_len;i++){if(sides_ar[1].substring(i,i+1)==\"+\"){r_sign_pos_str+=\"|\"+i;r_sign_str+=\"|+\";}else\nif(sides_ar[1].substring(i,i+1)==\"-\"){r_sign_pos_str+=\"|\"+i;r_sign_str+=\"|-\";}else{if(i==0){r_sign_pos_str+=\"|0\";r_sign_str+=\"|+\";}}}\nr_sign_pos_ar=r_sign_pos_str.split(\"|\");r_sign_ar=r_sign_str.split(\"|\");r_term_list=\"\";var r_term_ar=new Array();var r_term_ar=new Array();var equar_sign_chk=0;var term=\"\";for(s=1;s<r_sign_pos_ar.length;s++){term=sides_ar[1].substring(r_sign_pos_ar[s],r_sign_pos_ar[s+1]);dec_term=term;r_term_ar.push(term);if(v_equation.indexOf(\"/\")>-1){r_frac_idx_ar.push(r_term_ar.length-1);if(term.indexOf(\"/\")>-1){if(term.indexOf(v_variable)>-1){term=term.substring(0,term.length-1);r_frac_typ_ar.push(1);}else{r_frac_typ_ar.push(0);}\nvar frac_ar=term.split(\"/\");lcm_ar.push(frac_ar[1]);r_frac_num_ar.push(frac_ar[0]);r_frac_den_ar.push(frac_ar[1]);}else{if(term.indexOf(v_variable)>-1){term=term.substring(0,term.length-1);r_frac_typ_ar.push(1);}else{r_frac_typ_ar.push(0);}\nlcm_ar.push(1);r_frac_num_ar.push(term);r_frac_den_ar.push(1);}}\nif(v_equation.indexOf(\".\")>-1){if(dec_term.indexOf(v_variable)>-1){dec_term=dec_term.substring(0,term.length-1);r_dec_typ_ar.push(1);}else{r_dec_typ_ar.push(0);}\nr_dec_ar.push(dec_term);}}\nif(lcm_ar.length>0){var lcm=0;var mult_chk=0;var lcm_cnt=0;while(mult_chk==0&&lcm_cnt<100000){lcm_cnt+=1;lcm_rem=0;for(var i=0;i<lcm_ar.length;i++){lcm_rem+=lcm_cnt%lcm_ar[i];}\nif(lcm_rem==0){lcm=lcm_cnt;mult_chk=1;}}\nvar frac_num=0;var frac_div=0;for(var i=0;i<l_frac_idx_ar.length;i++){frac_div=lcm/l_frac_den_ar[i];frac_num=frac_div*l_frac_num_ar[i];if(l_frac_typ_ar[i]==1){l_term_ar[l_frac_idx_ar[i]]=\"\"+frac_num+\"\"+v_variable+\"\";if(l_dec_ar.length>0){l_dec_ar[i]=\"\"+frac_num+\"\";}}else{l_term_ar[l_frac_idx_ar[i]]=\"\"+frac_num+\"\";if(l_dec_ar.length>0){l_dec_ar[i]=\"\"+frac_num+\"\";}}}\nfor(var i=0;i<r_frac_idx_ar.length;i++){frac_div=lcm/r_frac_den_ar[i];frac_num=frac_div*r_frac_num_ar[i];if(r_frac_typ_ar[i]==1){r_term_ar[r_frac_idx_ar[i]]=\"\"+frac_num+\"\"+v_variable+\"\";if(r_dec_ar.length>0){r_dec_ar[i]=\"\"+frac_num+\"\";}}else{r_term_ar[r_frac_idx_ar[i]]=\"\"+frac_num+\"\";if(r_dec_ar.length>0){r_dec_ar[i]=\"\"+frac_num+\"\";}}}\ntbl+=\"<tr><td class='ChartTextCellLeft'>Fractions in the above equation were removed by multiplying both sides by \"+lcm+\" (\";tbl+=\"lowest common multiple of all denominators: \"+lcm_ar+\")</td>\";tbl+=\"<td class='ChartTextCell'>\";for(var i=0;i<l_term_ar.length;i++){if(l_term_ar[i].indexOf(\"-\")==-1&&i>0){tbl+=\"+\"+l_term_ar[i]+\"\";}else{tbl+=\"\"+l_term_ar[i]+\"\";}}\ntbl+=\"=\";for(var i=0;i<r_term_ar.length;i++){if(r_term_ar[i].indexOf(\"-\")==-1&&i>0){tbl+=\"+\"+r_term_ar[i]+\"\";}else{tbl+=\"\"+r_term_ar[i]+\"\";}}\ntbl+=\"</td></tr>\";}\nif(v_equation.indexOf(\".\")>-1){var dec_equiv=0;for(var i=0;i<l_dec_ar.length;i++){dec_equiv=Math.round(l_dec_ar[i]*100);if(l_dec_typ_ar[i]==1){l_term_ar[i]=\"\"+dec_equiv+\"\"+v_variable+\"\";}else{l_term_ar[i]=\"\"+dec_equiv+\"\";}}\nfor(var i=0;i<r_dec_ar.length;i++){dec_equiv=Math.round(r_dec_ar[i]*100);if(r_dec_typ_ar[i]==1){r_term_ar[i]=\"\"+dec_equiv+\"\"+v_variable+\"\";}else{r_term_ar[i]=\"\"+dec_equiv+\"\";}}\ntbl+=\"<tr><td class='ChartTextCellLeft'>Decimals removed from the above equation by multiplying both sides by 100: </td>\";tbl+=\"<td class='ChartTextCell'>\";for(var i=0;i<l_term_ar.length;i++){if(l_term_ar[i].indexOf(\"-\")==-1&&i>0){tbl+=\"+\"+l_term_ar[i]+\"\";}else{tbl+=\"\"+l_term_ar[i]+\"\";}}\ntbl+=\"=\";for(var i=0;i<r_term_ar.length;i++){if(r_term_ar[i].indexOf(\"-\")==-1&&i>0){tbl+=\"+\"+r_term_ar[i]+\"\";}else{tbl+=\"\"+r_term_ar[i]+\"\";}}\ntbl+=\"</td></tr>\";}\nvar l_coef_ar=new Array();var l_cons_ar=new Array();for(var i=0;i<l_term_ar.length;i++){if(l_term_ar[i].indexOf(v_variable)>-1){l_coef_ar.push(l_term_ar[i]);}else{l_cons_ar.push(l_term_ar[i]);}}\nvar l_cons=0;if(l_cons_ar.length>1){for(var i=0;i<l_cons_ar.length;i++){l_cons+=Number(l_cons_ar[i]);}}else\nif(l_cons_ar.length==1){l_cons=l_cons_ar[0];}\nvar l_coef=0;var l_coef_num=0;if(l_coef_ar.length>1){for(var i=0;i<l_coef_ar.length;i++){l_coef_num=l_coef_ar[i].substring(0,l_coef_ar[i].length-1);if(l_coef_num==\"\"||l_coef_num==\"+\"||l_coef_num==\"-\"){l_coef_num=\"\"+l_coef_num+\"1\";}\nl_coef+=Number(l_coef_num);}}else\nif(l_coef_ar.length==1){l_coef_num=l_coef_ar[0].substring(0,l_coef_ar[0].length-1);if(l_coef_num==\"\"||l_coef_num==\"+\"||l_coef_num==\"-\"){l_coef_num=\"\"+l_coef_num+\"1\";}\nl_coef+=Number(l_coef_num);}\nvar r_coef_ar=new Array();var r_cons_ar=new Array();for(var i=0;i<r_term_ar.length;i++){if(r_term_ar[i].indexOf(v_variable)>-1){r_coef_ar.push(r_term_ar[i]);}else{r_cons_ar.push(r_term_ar[i]);}}\nvar r_cons=0;if(r_cons_ar.length>1){for(var i=0;i<r_cons_ar.length;i++){r_cons+=Number(r_cons_ar[i]);}}else\nif(r_cons_ar.length==1){r_cons=r_cons_ar[0];}\nvar r_coef=0;var r_coef_num=0;if(r_coef_ar.length>1){for(var i=0;i<r_coef_ar.length;i++){r_coef_num=r_coef_ar[i].substring(0,r_coef_ar[i].length-1);if(r_coef_num==\"\"||r_coef_num==\"+\"||r_coef_num==\"-\"){r_coef_num=\"\"+r_coef_num+\"1\";}\nr_coef+=Number(r_coef_num);}}else\nif(r_coef_ar.length==1){r_coef_num=r_coef_ar[0].substring(0,r_coef_ar[0].length-1);if(r_coef_num==\"\"||r_coef_num==\"+\"||r_coef_num==\"-\"){r_coef_num=\"\"+r_coef_num+\"1\";}\nr_coef+=Number(r_coef_num);}\nif(l_cons_ar.length>1||r_cons_ar.length>1||l_coef_ar.length>1||r_coef_ar.length>1){tbl+=\"<tr><td class='ChartTextCellLeft'>Combining like terms \";var like_term_txt=\"\";if(l_coef_ar.length>0){like_term_txt+=\"\"+Number(l_coef)+\"\"+v_variable+\"\";if(l_coef_ar.length>1){tbl+=\" (\"+l_coef_ar+\") \";}}\nif(l_cons_ar.length>0){if(l_cons>0){like_term_txt+=\"+\"+Number(l_cons)+\"\";}else{like_term_txt+=\"\"+Number(l_cons)+\"\";}\nif(l_cons_ar.length>1){tbl+=\" (\"+l_cons_ar+\") \";}}\nlike_term_txt+=\"=\";if(r_coef_ar.length>0){like_term_txt+=\"\"+Number(r_coef)+\"\"+v_variable+\"\";if(r_coef_ar.length>1){tbl+=\" (\"+r_coef_ar+\") \";}}\nif(r_cons_ar.length>0){if(r_cons>0){like_term_txt+=\"+\"+Number(r_cons)+\"\";}else{like_term_txt+=\"\"+Number(r_cons)+\"\";}\nif(r_cons_ar.length>1){tbl+=\" (\"+r_cons_ar+\") \";}}\ntbl+=\" on both sides of the above equation leaves: </td>\";tbl+=\"<td class='ChartTextCell'>\"+like_term_txt+\"\";tbl+=\"</td></tr>\";}\nif(l_coef!=0&&r_coef!=0){if(r_coef>0){l_coef=Number(l_coef)-Number(Math.abs(r_coef));tbl+=\"<tr><td class='ChartTextCellLeft'>Subtracting \"+Number(Math.abs(r_coef))+\"\"+v_variable+\" from \";tbl+=\"both sides of the above equation leaves:</td>\";tbl+=\"<td class='ChartTextCell'>\";tbl+=\"\"+write_equat(l_coef,l_cons,0,r_cons,v_variable)+\"\";tbl+=\"</td></tr>\";}else{l_coef=Number(l_coef)+Number(Math.abs(r_coef));tbl+=\"<tr><td class='ChartTextCellLeft'>Adding \"+Number(Math.abs(r_coef))+\"\"+v_variable+\" to \";tbl+=\"both sides of the above equation leaves:</td>\";tbl+=\"<td class='ChartTextCell'>\";tbl+=\"\"+write_equat(l_coef,l_cons,0,r_cons,v_variable)+\"\";tbl+=\"</td></tr>\";}\nr_coef=0;}\nif(l_cons!=0&&r_cons!=0){if(l_coef!=0){if(l_cons>0){r_cons=Number(r_cons)-Number(Math.abs(l_cons));tbl+=\"<tr><td class='ChartTextCellLeft'>Subtracting \"+Number(Math.abs(l_cons))+\" from both \";tbl+=\"sides of the above equation leaves:</td>\";tbl+=\"<td class='ChartTextCell'>\";tbl+=\"\"+write_equat(l_coef,0,r_coef,r_cons,v_variable)+\"\";tbl+=\"</td></tr>\";}else{r_cons=Number(r_cons)+Number(Math.abs(l_cons));tbl+=\"<tr><td class='ChartTextCellLeft'>Adding \"+Number(Math.abs(l_cons))+\" to both \";tbl+=\"sides of the above equation leaves:</td>\";tbl+=\"<td class='ChartTextCell'>\";tbl+=\"\"+write_equat(l_coef,0,r_coef,r_cons,v_variable)+\"\";tbl+=\"</td></tr>\";}\nl_cons=0;}else{if(r_cons>0){l_cons=Number(l_cons)-Number(Math.abs(r_cons));tbl+=\"<tr><td class='ChartTextCellLeft'>Subtracting \"+Number(Math.abs(r_cons))+\" from both \";tbl+=\"sides of the above equation leaves:</td>\";tbl+=\"<td class='ChartTextCell'>\";tbl+=\"\"+write_equat(l_coef,l_cons,r_coef,0,v_variable)+\"\";tbl+=\"</td></tr>\";}else{l_cons=Number(l_cons)+Number(Math.abs(r_cons));tbl+=\"<tr><td class='ChartTextCellLeft'>Adding \"+Number(Math.abs(r_cons))+\" to both \";tbl+=\"sides of the above equation leaves:</td>\";tbl+=\"<td class='ChartTextCell'>\";tbl+=\"\"+write_equat(l_coef,l_cons,r_coef,0,v_variable)+\"\";tbl+=\"</td></tr>\";}\nr_cons=0;}}\nvar v_ans=\"\";var red_tbl=\"\";if(l_coef==0&&r_coef==0){tbl+=\"<tr><td class='ChartTextCellLeft'>Result:</td><td class='ChartTextCell'>\";if(l_cons==r_cons){v_ans=\"\"+v_variable+\" = All Real Numbers\";tbl+=\"\"+v_variable+\" = All Real Numbers\";}else{v_ans=\"No Solution\";tbl+=\"No Solution\";}\ntbl+=\"</td></tr>\";}else\nif(l_coef!=0){tbl+=\"<tr><td class='ChartTextCellLeft'>Divide both sides of the above equation by \"+l_coef+\": </td><td class='ChartTextCell'>\";tbl+=\"<center><table><tr><td style='border-bottom: 1px solid #000; text-align: center;'>\"+l_coef+\"\"+v_variable+\"</td>\";tbl+=\"<td rowspan='2' style='vertical-align: middle'>=</td>\";tbl+=\"<td style='text-align: center; border-bottom: 1px solid #000''>\"+r_cons+\"</td></tr>\";tbl+=\"<tr><td style='text-align: center;'>\"+l_coef+\"</td>\";tbl+=\"<td style='text-align: center;'>\"+l_coef+\"</td></tr></table></center></td></tr>\";tbl+=\"<tr><td class='ChartTextCellLeft'>Result: </td><td class='ChartTextCell'>\";if(r_cons%l_coef==0){r_cons=r_cons/l_coef;tbl+=\"\"+v_variable+\" = \"+r_cons+\"\";document.calc.ans.value=\"\"+v_variable+\" = \"+r_cons+\"\";}else{tbl+=\"\"+reduce_fract(r_cons,l_coef,v_variable)+\"\";}\ntbl+=\"</td></tr>\";}else{tbl+=\"<tr><td class='ChartTextCellLeft'>Divide both sides of the above equation by \"+r_coef+\": </td><td class='ChartTextCell'>\";tbl+=\"<center><table><tr><td style='border-bottom: 1px solid #000; text-align: center;'>\"+l_cons+\"</td>\";tbl+=\"<td rowspan='2' style='vertical-align: middle'>=</td>\";tbl+=\"<td style='text-align: center; border-bottom: 1px solid #000''>\"+r_coef+\"\"+v_variable+\"</td></tr>\";tbl+=\"<tr><td style='text-align: center;'>\"+r_coef+\"</td>\";tbl+=\"<td style='text-align: center;'>\"+r_coef+\"</td></tr></table></center></td></tr>\";tbl+=\"<tr><td class='ChartTextCellLeft'>Result: </td><td class='ChartTextCell'>\";if(l_cons%r_coef==0){l_cons=l_cons/r_coef;tbl+=\"\"+l_cons+\" = \"+v_variable+\"\";document.calc.ans.value=\"\"+l_cons+\" = \"+v_variable+\"\";}else{tbl+=\"\"+reduce_fract(l_cons,r_coef,v_variable)+\"\";}\ntbl+=\"</td></tr>\";}\ntbl+=\"</table></center><br /><br />\";document.getElementById(\"summary\").innerHTML=tbl;}}\nfunction write_equat(lf,lc,rf,rc,v){var equat_txt=\"\"\nvar left_cnt=0;if(lf!=0){left_cnt+=1;}\nif(lc!=0){left_cnt+=1;}\nvar right_cnt=0;if(rf!=0){right_cnt+=1;}\nif(rc!=0){right_cnt+=1;}\nif(lf!=0){equat_txt+=\"\"+Number(lf)+\"\"+v+\"\";}\nif(lc!=0){if(lc>0&&left_cnt>1){equat_txt+=\"+\"+Number(lc)+\"\";}else{equat_txt+=\"\"+Number(lc)+\"\";}}\nequat_txt+=\"=\";if(rf!=0){equat_txt+=\"\"+Number(rf)+\"\"+v+\"\";}\nif(rc!=0){if(rc>0&&right_cnt>1){equat_txt+=\"+\"+Number(rc)+\"\";}else{equat_txt+=\"\"+Number(rc)+\"\";}}\nreturn equat_txt;}\nfunction reduce_fract(numer,denom,v){var sign=\"\";if(numer<0&&denom<0){numer=Math.abs(numer);denom=Math.abs(denom);}else\nif(numer<0||denom<0){numer=Math.abs(numer);denom=Math.abs(denom);sign=\"-\";}\nvar max_gcf=0;if(numer>denom){max_gcf=numer;}else\nif(denom>numer){max_gcf=denom;}else{max_gcf=1;}\nvar v_gfc=1;var cnt=max_gcf;var mult_chk=0\nwhile(cnt>0){if(numer%cnt==0&&denom%cnt==0&&mult_chk==0){v_gcf=cnt;mult_chk=1;}\ncnt--;}\nvar v_red_numer=numer/v_gcf;var v_red_denom=denom/v_gcf;document.calc.ans.value=\"\"+v+\" = \"+sign+\"\"+v_red_numer+\"/\"+v_red_denom+\"\";var numer_style=\"style='border-bottom: 1px solid black; text-align: center; font-weight: normal;'\";var equal_style=\"style='vertical-align: middle; text-align: center; font-weight: normal;'\";var whole_style=\"style='vertical-align: middle; text-align: center; font-weight: normal; font-size: 18pt;'\";var rtbl=\"<center><table>\";rtbl+=\"<tr>\";rtbl+=\"<td rowspan='2' \"+equal_style+\">\"+v+\"</td>\";rtbl+=\"<td rowspan='2' \"+equal_style+\">=</td>\";rtbl+=\"<td rowspan='2' \"+equal_style+\">\"+sign+\"</td>\";rtbl+=\"<td \"+numer_style+\">\"+numer+\"</td>\";if(v_gcf>1){rtbl+=\"<td rowspan='2' \"+equal_style+\">=</td>\";rtbl+=\"<td rowspan='2' \"+equal_style+\">\"+sign+\"</td>\";rtbl+=\"<td \"+numer_style+\">\"+numer+\" ÷ \"+v_gcf+\"</td>\";rtbl+=\"<td rowspan='2' \"+equal_style+\">=</td>\";rtbl+=\"<td rowspan='2' \"+equal_style+\">\"+sign+\"</td>\";rtbl+=\"<td \"+numer_style+\">\"+v_red_numer+\"</td>\";}\nif(numer>denom){var whole_num=Math.floor(v_red_numer/v_red_denom);var mixed_numer=v_red_numer%v_red_denom;rtbl+=\"<td rowspan='2' \"+equal_style+\"> or </td>\";rtbl+=\"<td rowspan='2' \"+equal_style+\">\"+sign+\"</td>\";rtbl+=\"<td rowspan='2' \"+whole_style+\">\"+whole_num+\"</td>\";if(mixed_numer>0){rtbl+=\"<td \"+numer_style+\">\"+mixed_numer+\"</td>\";}}\nrtbl+=\"</tr>\";rtbl+=\"<tr>\";rtbl+=\"<td style='text-align: center; font-weight: normal;'>\"+denom+\"</td>\";if(v_gcf>1){rtbl+=\"<td style='text-align: center; font-weight: normal;'>\"+denom+\" ÷ \"+v_gcf+\"</td>\";rtbl+=\"<td style='text-align: center; font-weight: normal;'>\"+v_red_denom+\"</td>\";}\nif(numer>denom){if(mixed_numer>0){rtbl+=\"<td style='text-align: center; font-weight: normal;'>\"+v_red_denom+\"</td>\";}}\nrtbl+=\"</tr>\";rtbl+=\"</table></center>\";return rtbl;}\nfunction clear_results(form){document.calc.ans.value=\"\";document.getElementById(\"summary\").innerHTML=\"\";}\nfunction reset_calc(form){document.getElementById(\"summary\").innerHTML=\"\";document.calc.reset();}";
var mod_pagespeed_PJWHvBYF1j = "var offsetfromcursorX=12\nvar offsetfromcursorY=10\nvar offsetdivfrompointerX=10\nvar offsetdivfrompointerY=14\ndocument.write('<div class=\"div_help\" id=\"dhtmltooltip\" onClick=\"hideddrivetip()\"></div>')\ndocument.write('<img id=\"dhtmlpointer\" src=\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHSLSkgqRY3PY_iFXdVxZzoPMK12-GxS8IPLF3nONJTGil5Q6QndcuvQRCPGPByHYCMcgl3VSzfR0qAkMJvnpaz6V-xzGJNDWC00aZY3aPNIIPzoesvPpp_qVyIrdLbs69xt8kNPaco3ZR/s72-c/BASIC+JAVA+CALCULATOR.png\">')\nvar ie=document.all\nvar ns6=document.getElementById&&!document.all\nvar enabletip=false\nif(ie||ns6)\nvar tipobj=document.all?document.all[\"dhtmltooltip\"]:document.getElementById?document.getElementById(\"dhtmltooltip\"):\"\"\nvar pointerobj=document.all?document.all[\"dhtmlpointer\"]:document.getElementById?document.getElementById(\"dhtmlpointer\"):\"\"\nfunction ietruebody(){return(document.compatMode&&document.compatMode!=\"BackCompat\")?document.documentElement:document.body}\nfunction ddrivetip(thetext,thewidth,thecolor){if(ns6||ie){if(typeof thewidth!=\"undefined\")tipobj.style.width=thewidth+\"px\"\nif(typeof thecolor!=\"undefined\"&&thecolor!=\"\")tipobj.style.backgroundColor=thecolor\ntipobj.innerHTML=thetext\nenabletip=true\nreturn false}}\nfunction positiontip(e){if(enabletip){var nondefaultpos=false\nvar curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var winwidth=ie&&!window.opera?ietruebody().clientWidth:window.innerWidth-20\nvar winheight=ie&&!window.opera?ietruebody().clientHeight:window.innerHeight-20\nvar rightedge=ie&&!window.opera?winwidth-event.clientX-offsetfromcursorX:winwidth-e.clientX-offsetfromcursorX\nvar bottomedge=ie&&!window.opera?winheight-event.clientY-offsetfromcursorY:winheight-e.clientY-offsetfromcursorY\nvar leftedge=(offsetfromcursorX<0)?offsetfromcursorX*(-1):-1000\nif(rightedge<tipobj.offsetWidth){tipobj.style.left=curX-tipobj.offsetWidth+\"px\"\nnondefaultpos=true}\nelse if(curX<leftedge)\ntipobj.style.left=\"5px\"\nelse{tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+\"px\"\npointerobj.style.left=curX+offsetfromcursorX+\"px\"}\nif(bottomedge<tipobj.offsetHeight){tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+\"px\"\nnondefaultpos=true}\nelse{tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+\"px\"\npointerobj.style.top=curY+offsetfromcursorY+\"px\"}\ntipobj.style.visibility=\"visible\"\nif(!nondefaultpos)\npointerobj.style.visibility=\"visible\"\nelse\npointerobj.style.visibility=\"hidden\"}}\nfunction hideddrivetip(){if(ns6||ie){enabletip=false\ntipobj.style.visibility=\"hidden\"\npointerobj.style.visibility=\"hidden\"\ntipobj.style.left=\"-1000px\"\ntipobj.style.backgroundColor=''\ntipobj.style.width=''}}\ndocument.onmousemove=positiontip\nfunction sn(num){num=num.toString();var len=num.length;var rnum=\"\";var test=\"\";var j=0;var b=num.substring(0,1);if(b==\"-\"){rnum=\"-\";}\nfor(i=0;i<=len;i++){b=num.substring(i,i+1);if(b==\"0\"||b==\"1\"||b==\"2\"||b==\"3\"||b==\"4\"||b==\"5\"||b==\"6\"||b==\"7\"||b==\"8\"||b==\"9\"||b==\".\"){rnum=rnum+\"\"+b;}}\nif(rnum==\"\"||rnum==\"-\"){rnum=0;}\nrnum=Number(rnum);return rnum;}\nfunction fns(num,places,comma,type,show){var sym_1=\"$\";var sym_2=\"\";var isNeg=0;if(num<0){num=num*-1;isNeg=1;}\nvar myDecFact=1;var myPlaces=0;var myZeros=\"\";while(myPlaces<places){myDecFact=myDecFact*10;myPlaces=Number(myPlaces)+Number(1);myZeros=myZeros+\"0\";}\nonum=Math.round(num*myDecFact)/myDecFact;integer=Math.floor(onum);if(Math.ceil(onum)==integer){decimal=myZeros;}else{decimal=Math.round((onum-integer)*myDecFact)}\ndecimal=decimal.toString();if(decimal.length<places){fillZeroes=places-decimal.length;for(z=0;z<fillZeroes;z++){decimal=\"0\"+decimal;}}\nif(places>0){decimal=\".\"+decimal;}\nif(comma==1){integer=integer.toString();var tmpnum=\"\";var tmpinteger=\"\";var y=0;for(x=integer.length;x>0;x--){tmpnum=tmpnum+integer.charAt(x-1);y=y+1;if(y==3&x>1){tmpnum=tmpnum+\",\";y=0;}}\nfor(x=tmpnum.length;x>0;x--){tmpinteger=tmpinteger+tmpnum.charAt(x-1);}\nfinNum=tmpinteger+\"\"+decimal;}else{finNum=integer+\"\"+decimal;}\nif(isNeg==1){if(type==1&&show==1){finNum=\"-\"+sym_1+\"\"+finNum+\"\"+sym_2;}else{finNum=\"-\"+finNum;}}else{if(show==1){if(type==1){finNum=sym_1+\"\"+finNum+\"\"+sym_2;}else\nif(type==2){finNum=finNum+\"%\";}}}\nreturn finNum;}\nfunction side_calc_b(num){var v_result=document.side_calc.result.value;if(v_result.length<10){var v_new_result=v_result+\"\"+num;document.side_calc.result.value=v_new_result;}}\nfunction side_calc_del(num){var v_result=document.side_calc.result.value;if(v_result.length>0){var v_new_result=v_result.substring(0,v_result.length-1);document.side_calc.result.value=v_new_result;}}\nfunction side_calc_sign(sgn){document.side_calc.h_sign.value=sgn;document.side_calc.h_num_1.value=document.side_calc.result.value;document.side_calc.result.value=\"\";var tape_sgn=\"\";if(sgn!=\"\"){if(sgn==\"/\"){tape_sgn=\"÷\";}else\nif(sgn==\"*\"){tape_sgn=\"×\";}else\nif(sgn==\"-\"){tape_sgn=\"-\";}else\nif(sgn==\"+\"){tape_sgn=\"+\";}}\nvar tape_new=document.getElementById(\"side_calc_tape_new\").innerHTML;var new_tape=\"\"+document.side_calc.h_num_1.value+\" \"+tape_sgn+\"\";document.getElementById(\"side_calc_tape_new\").innerHTML=new_tape;}\nfunction side_calc_equal(form){var v_1=Number(document.side_calc.h_num_1.value);var v_2=Number(document.side_calc.result.value);var v_sign=document.getElementById(\"h_sign\").value;var v_new_result=0;if(v_sign!=\"\"){if(v_sign==\"/\"){v_new_result=v_1/v_2;}else\nif(v_sign==\"*\"){v_new_result=v_1*v_2;}else\nif(v_sign==\"-\"){v_new_result=v_1-v_2;}else\nif(v_sign==\"+\"){v_new_result=v_1+v_2;}\nif(v_new_result>99999999.99||v_new_result<-99999999.99){alert(\"Sorry, the result is too big (greater than 1 billion) for this calculator.\");}else{document.side_calc.result.value=v_new_result;document.side_calc.h_num_1.value=v_new_result;document.side_calc.h_sign.value=\"\";var tape_new=document.getElementById(\"side_calc_tape_new\").innerHTML;var new_tape=\"\"+tape_new+\" \"+v_2+\" = \"+v_new_result+\"\";document.getElementById(\"side_calc_tape_new\").innerHTML=\"\";var tape_old=document.getElementById(\"side_calc_tape_old\").innerHTML;document.getElementById(\"side_calc_tape_old\").innerHTML=\"\"+new_tape+\"<hr style='border: dashed #EEEEEE 1px; line-height: 1;'>\"+tape_old+\"\";document.getElementById(\"side_calc_tape_but\").innerHTML=\"<input type='button' value='Throw Away' onClick='side_calc_clr_tape(this.form)' class='SideCalcClrTape' />\";}}}\nfunction side_calc_pm(form){var v_pm=Number(document.side_calc.result.value);v_pm=v_pm*-1;document.side_calc.result.value=v_pm;}\nfunction side_calc_clr(form){document.side_calc.result.value=\"\";document.side_calc.h_num_1.value=\"\";document.side_calc.h_sign.value=\"\";}\nfunction side_calc_clr_tape(form){document.getElementById(\"side_calc_tape_new\").innerHTML=\"\";document.getElementById(\"side_calc_tape_old\").innerHTML=\"\";document.getElementById(\"side_calc_tape_but\").innerHTML=\"\";}\nvar soc_ad_ar=[[0,\"\",\"\",\"\"],[1,\"Auto\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[2,\"Budget\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[3,\"Credit\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[4,\"Debt\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[5,\"Income\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[6,\"Invest\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[7,\"Loan\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[8,\"Mortgage\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[9,\"Finance\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[10,\"Retire\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[11,\"College\",\"WyzAnt\",\"Find a <a href='http://www.shareasale.com/r.cfm?b=246096&u=724440&m=28558&urllink=&afftrack=' rel='nofollow' target='_blank'>local tutor</a> today!\"],[12,\"Business\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[13,\"\",\"\",\"\"],[14,\"\",\"\",\"\"],[15,\"\",\"\",\"\"],[16,\"\",\"\",\"\"],[17,\"\",\"\",\"\"],[18,\"\",\"\",\"\"],[19,\"\",\"\",\"\"],[20,\"Date\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[21,\"Conversion\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[22,\"Math\",\"WyzAnt\",\"Find a local <a href='http://www.shareasale.com/r.cfm?b=246097&u=724440&m=28558&urllink=&afftrack=' rel='nofollow' target='_blank'>math tutor</a> today!\"],[23,\"Date\",\"SocialMedia\",\"If you like this calculator, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"],[24,\"Sports\",\"SocialMedia\",\"If you like this web app, please pay it forward with a <strong>Like</strong>, <strong>Tweet</strong>, <strong>+1</strong>, or <strong>Pin</strong>.\"]];";
</script>
<script>eval(mod_pagespeed_fhLIhm5NFj);</script>
<script>eval(mod_pagespeed_PJWHvBYF1j);</script>
</head>
<body>
<form name="calc" method="post" action="#">
<table class="CalcTable">
<tbody>
<tr>
<td colspan="2" align="center" class="CalcTitleCell">
LINEAR EQUATION SOLVER
</td>
</tr>
<tr>
<td colspan="2" class="CalcInstructCell">
<br/>
<br/>
<strong>Instructions:</strong> Enter a linear equation that fits within the following current guidelines.
<ul>
<p>
<li>No spaces between terms or operators.</li>
</p>
<p>
<li>One variable only and no radicals or exponents.</li>
</p>
<p>
<li>Parenthesis only for distribution and no more than 2 terms within a parenthesis, and no nested parenthesis (parenthesis inside parenthesis).</li>
</p>
<p>
<li>Numerators and denominators must be integers only (no expressions).</li>
</p>
<p>
<li>Decimal numbers can have a maximum of 2 decimal points.</li>
</p>
</ul>
<p>
Next, click the "Solve Linear Equation" button.
</p>
<p>
<strong><u>IMPORTANT!</u> Since it is impossible to test all possible equations with all web browsers and version releases, be sure to substitute the calculated result for the variable and solve the resulting equation to make sure the calculated result is in fact a solution for the equation.</strong>
</p>
<p>
Mouse over the blue question marks for a further explanation of each entry field or button. More in-depth explanations can be found in the glossary of terms located beneath the Linear Equation Solver.
</p>
</td>
</tr>
<tr class="ChartRowOdd">
<td width="300" class="ChartTextCellLeft">
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/2wBDAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx//2wBDAQcHBw0MDRgQEBgaFREVGh8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx//wAARCAAPAA8DAREAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAABQP/xAAkEAACAgEDBAIDAAAAAAAAAAABAgMFBAYRIQAHEjETIhUjYf/EABYBAQEBAAAAAAAAAAAAAAAAAAIDBf/EACARAQAABgIDAQAAAAAAAAAAAAEAAgMREkExURNhceH/2gAMAwEAAhEDEQA/AL5OrLB+4uo6+zvdSmBLLKhra6kyX+UkZLqEVXYqqog4AH862SkeOVCXjcZjO5os3OoYr/z+J3mXSA1ZcZ9ZNj5SMWzJWnjaSvlbY/Yx/NE+xU7cMAffU5sWjniD89wy5UxybfkDrp3VEHd+1salYcvMaysHxMbCtqyHM/Y8vlskrZDKRGW81aLcDf0eRTOVpA9Gm0DCbyKduyAtHaOu4LvId8iuLmutUAS1rZH85K3IQcJkM23k32b0o5OwBPVatUtvk09nqBTpt9cOzqP/2Q==" alt="Help" onMouseover="ddrivetip('To see an example of how the linear equation solver calculates a solution, select an equation from the drop down menu - which will enter the selection in the equation field for solving.', 250)" ; onMouseout="hideddrivetip()">
Example linear equations:
</td>
<td width="300" class="ChartTextCell">
<select name="samps" size="1" onChange="get_samp(this.form)">
<option value="">----ENTER MY OWN----</option>
<option value="">----BASIC----</option>
<option value="10-3x=7">10-3x=7</option>
<option value="5x-6=3x-8">5x-6=3x-8</option>
<option value="">----DISTRIBUTION----</option>
<option value="2(x+5)-7=3(x-2)">2(x+5)-7=3(x-2)</option>
<option value="2(3x-7)+4(3x+2)=6(5x+9)+3">2(3x-7)+4(3x+2)=6(5x+9)+3</option>
<option value="">----FRACTIONS----</option>
<option value="5/4x+1/2=2x-1/2">5/4x+1/2=2x-1/2</option>
<option value="3/4x+5/6=5x-125/3">3/4x+5/6=5x-125/3</option>
<option value="">----DECIMALS----</option>
<option value=".25a-.05=.2a+.15">.25a-.05=.2a+.15</option>
<option value=".35y-.2=.15y+.1">.35y-.2=.15y+.1</option>
</select>
</td>
</tr>
<tr class="ChartRowEven">
<td width="300" class="ChartTextCellLeft">
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/2wBDAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx//2wBDAQcHBw0MDRgQEBgaFREVGh8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx//wAARCAAPAA8DAREAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAABQP/xAAkEAACAgEDBAIDAAAAAAAAAAABAgMFBAYRIQAHEjETIhUjYf/EABYBAQEBAAAAAAAAAAAAAAAAAAIDBf/EACARAQAABgIDAQAAAAAAAAAAAAEAAgMREkExURNhceH/2gAMAwEAAhEDEQA/AL5OrLB+4uo6+zvdSmBLLKhra6kyX+UkZLqEVXYqqog4AH862SkeOVCXjcZjO5os3OoYr/z+J3mXSA1ZcZ9ZNj5SMWzJWnjaSvlbY/Yx/NE+xU7cMAffU5sWjniD89wy5UxybfkDrp3VEHd+1salYcvMaysHxMbCtqyHM/Y8vlskrZDKRGW81aLcDf0eRTOVpA9Gm0DCbyKduyAtHaOu4LvId8iuLmutUAS1rZH85K3IQcJkM23k32b0o5OwBPVatUtvk09nqBTpt9cOzqP/2Q==" alt="Help" onMouseover="ddrivetip('Enter an equation that fits within the guidelines stated at the top of the linear equation solver.', 250)" ; onMouseout="hideddrivetip()">
Linear equation:
</td>
<td width="300" class="ChartTextCell">
<input type="text" id="equation" name="equation" size="40" value="" class="CalcInFld" onKeyUp="clear_results(this.form)"/>
</td>
</tr>
<tr class="ChartRowOdd">
<td colspan="2" class="ChartTextCell">
<input type="button" value="Solve Linear Equation" class="CalcButton" onClick="solve_equation(this.form)">
<input type="button" value="Reset" class="CalcButton" onClick="reset_calc(this.form)">
</td>
</tr>
<tr class="ChartRowEven">
<td width="300" class="ChartTextCellLeft">
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/2wBDAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx//2wBDAQcHBw0MDRgQEBgaFREVGh8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx//wAARCAAPAA8DAREAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAABQP/xAAkEAACAgEDBAIDAAAAAAAAAAABAgMFBAYRIQAHEjETIhUjYf/EABYBAQEBAAAAAAAAAAAAAAAAAAIDBf/EACARAQAABgIDAQAAAAAAAAAAAAEAAgMREkExURNhceH/2gAMAwEAAhEDEQA/AL5OrLB+4uo6+zvdSmBLLKhra6kyX+UkZLqEVXYqqog4AH862SkeOVCXjcZjO5os3OoYr/z+J3mXSA1ZcZ9ZNj5SMWzJWnjaSvlbY/Yx/NE+xU7cMAffU5sWjniD89wy5UxybfkDrp3VEHd+1salYcvMaysHxMbCtqyHM/Y8vlskrZDKRGW81aLcDf0eRTOVpA9Gm0DCbyKduyAtHaOu4LvId8iuLmutUAS1rZH85K3IQcJkM23k32b0o5OwBPVatUtvk09nqBTpt9cOzqP/2Q==" alt="Help" onMouseover="ddrivetip('This is the result calculated by the linear equation solver for the entered equation. Please substitute the calculated result for the variable to make sure the result is in fact a solution to the equation.', 250)" ; onMouseout="hideddrivetip()">
Calculated solution:
</td>
<td width="300" class="ChartTextCell">
<input type="text" id="ans" name="ans" size="25" value="" class="CalcOutFldEven"/>
</td>
</tr>
<tr class="ChartRowOdd">
<td colspan="2" class="CalcSummaryCell" id="summary">
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
What is a Linear Equation?
A linear equation is an expression that can be written in the form ax+b=0, where a and b are constants and x represents an unknown variable that, once found, will make the expression true. The following are some basic examples of linear equations having one variable:
2(y + 1) - 4 = 4(y - 3)
16.5a + .25a = 25.1a
1 | x | + | 3 | = | 2 | x | - | 4 | ||
2 | 4 | 5 |
How to Solve Linear Equations
Solving linear equations is a process aimed at getting the variable by itself on one side of an equal sign and everything else on the other side. In order to explain how to solve linear equations, I will use an example equation that contains all 4 types of terms that can be handled by the linear equation solver.
Example equation: | 3(x-1)+1/2=.25+4 | ||||||||||||||||||
First use the distributive property to get rid of the parenthesis: | 3(x-1) = 3x-3 | ||||||||||||||||||
After removing parenthesis we are left with: | 3x-3+1/2=.25+4 | ||||||||||||||||||
Remove the fractions by multiplying both sides of the equation by 2 (least common multiple of all denominators in equation): | 2(3x-3+1/2)=2(.25+4) | ||||||||||||||||||
After multiplying both sides by 2 we are left with: | 6x-6+1=0.5+8 | ||||||||||||||||||
Remove decimals by multiplying both sides of the equation by 100: | 100(6x-6+1)=100(0.5+8) | ||||||||||||||||||
After multiplying both sides by 100 we are left with: | 600x-600+100=50+800 | ||||||||||||||||||
Combine the like terms: | -600 + 100 = -500 and 50 + 800 = 850 | ||||||||||||||||||
After combining like terms we are left with: | 600x-500=+850 | ||||||||||||||||||
Add 500 to both sides of the above equation to get constants on right side: | -500 + 500 = 0 and 850 + 500 = 1350 | ||||||||||||||||||
After adding 500 to both sides we are left with: | 600x=1350 | ||||||||||||||||||
Get the variable by itself by dividing both sides by 600: |
|
||||||||||||||||||
After dividing both sides by 600 we are left with: |
|
||||||||||||||||||
Simplify the result: |
|
Always Check to Make Sure Your Answer is a Solution
Regardless of which method or tool you use to solve linear equations, you should always check your results by substituting the result for the variable and seeing if the resulting equation proves to be true. After all, humans create math solvers, and humans make mistakes.
In order to make sure our answer to the above example linear equation is in fact a solution, let's substitute 9/4 for x and check to see if the resulting equation proves to be true:
4(27/4 - 3/1 + 1/2) = 4(4.25)
27 - 12 + 2 = 17
15 + 2 = 17
17 = 17
The solution 9/4 is the solution to the example equation.
With that, let's use the Linear Equation Solver for solving linear equations using the distributive property, the addition, subtraction, multiplication, and division properties of equality, as well the necessary inverse operations.
Related movie you might like to see :












Recommended for you
Related Post for LINEAR EQUATION SOLVER CODE
PRIME FACTORS BRANCH CALCULATOR CODE ----------------------------------------------------------------------------------------------------------------- COPY AND PASTE BELOW CODE IN POST HTML SECTION ---------------…
DATA URI CODE IMAGE CONVERT INTO JPG IMAGE Best Online Base64 to Image converter .arrow_box { position: relative; background: #ffffff; border: 4px solid #E9E9E9; } .arrow_box:after,.arrow_box:before { top: 100%; lef…
LINEAR EQUATION CALCULATOR CODE ----------------------------------------------------------------------------------------------------------------- COPY AND PASTE BELOW CODE IN POST HTML SECTION ---------------…
LINEAR EQUATION CALCULATOR #parse_btn { background-color:Blue; color:#FFFFFF; font-size:30px; width:200px; height:50px; } x=3;y=7 Calculate it! Solve Graph Lesson Sh…
PRIME FACTORS BRANCH CALCULATOR PRIME FACTORS /* AngularJS v1.2.20 (c) 2010-2014 Google, Inc. http://angularjs.org License: MIT */ (function(S,U,s){'use strict';function v(b){return function(){var …
GREATEST COMMON FACTOR CALCULATOR CODE -------------------------------------------------------------------------------------------------------------------------- READ MORE: http://maths.wordpandit.com/h-c-f-by-…
HCF AND LCM WITH BRACH METHOD CALCULATOR CODE ----------------------------------------------------------------------------------------------------------------- COPY AND PASTE BELOW CODE IN POST HTML SECTION ---------------…
HOW MANY DIVISORS DOES A NUMBER HAVE? -------------------------------------------------------------------------------------------------------------------------- READ MORE: http://primes.utm.edu/glossary/xpage/tau.…
HCF AND LCM WITH BRACH METHOD CALCULATOR HIGHEST COMMON FACTOR AND LOWEST COMMON MULTIPLE /* AngularJS v1.2.20 (c) 2010-2014 Google, Inc. http://angularjs.org License: MIT */ (function(S,U,s){'use strict';fu…
URDU TYPE WRITER Urdu keyboard Online .bt {cursor:pointer; width:32pt; font-size:20pt; color:#CC0033; font-family:'Times New Roman'; } .bta {cursor:pointer; width:38pt; font-size:20pt; …
URDU TYPE WRITER CODE ----------------------------------------------------------------------------------------------------------------- COPY AND PASTE BELOW CODE IN POST HTML SECTION --------------…
HOW MANY DIVISORS DOES A NUMBER HAVE? -------------------------------------------------------------------------------------------------------------------------- READ MORE: http://www.javascripter.net/math/calculat…
0 comments:
Post a Comment
Click to see the code!
To insert emoticon you must added at least one space before the code.