Friday, October 14, 2022

p=(x+y+z)/3, 1/q=(1/x+1/y+1/z)/3, r=(xyz)^(1/3)

 p=(x+y+z)/3

1/q=(1/x+1/y+1/z)/3

r=(xyz)1/3                                  https://start--js.blogspot.com/p/xyz.html


X=<input id="InputBox1" size="1" value="1" /><br />

Y=<input id="InputBox2" size="1" value="2" /><br /> 

Z=<input id="InputBox3" size="1" value="3" /><br /><br />

<br />

<button onclick="CalculationFunction()">Calculate</button><br /><br />

<input id="OutputBox1" size="18" /><input id="ExponentialOutputBox1" size="6" /><input id="RoundingOutputBox1" size="6" /><br />

<input id="OutputBox2" size="18" /><input id="ExponentialOutputBox2" size="6" /><input id="RoundingOutputBox2" size="6" /><br />

<input id="OutputBox3" size="18" /><input id="ExponentialOutputBox3" size="6" /><input id="RoundingOutputBox3" size="6" /><br />

<script>

function CalculationFunction()

  {var x,y,z,p,q, r,xx,yy,zz;

   x=Number(document.getElementById("InputBox1").value);

   y=Number(document.getElementById("InputBox2").value);

   z=Number(document.getElementById("InputBox3").value);

   p=(x+y+z)/3;

   q=1/((1/x+1/y+1/z)/3);

   r=Math.pow(x*y*z,1/3);

   document.getElementById("OutputBox1").value=p; 

   document.getElementById("OutputBox2").value=q; 

   document.getElementById("OutputBox3").value=r; 

   document.getElementById("ExponentialOutputBox1").value=p.toExponential(2); 

   document.getElementById("ExponentialOutputBox2").value=q.toExponential(2); 

   document.getElementById("ExponentialOutputBox3").value=r.toExponential(2); 

   xx=Number(document.getElementById("ExponentialOutputBox1").value);

   yy=Number(document.getElementById("ExponentialOutputBox2").value);

   zz=Number(document.getElementById("ExponentialOutputBox3").value);

   document.getElementById("RoundingOutputBox1").value=xx;

   document.getElementById("RoundingOutputBox2").value=yy;

   document.getElementById("RoundingOutputBox3").value=zz;

   }

</script> 

<br />Template 01 


No comments:

Post a Comment

N-point Star in Microsoft Visual Studio Console App

#include <windows.h> #include <cmath> #include <iostream> LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,...