Salutare!
Incerc sa rezolv prin intermediul unei functii javascript o ecuatie de gradul 1
<html>
<head>
<script type="text/javascript">
function rezolvare()
{
// convertire coeficienti
var A = parseFloat(document.getElementById('A').value);
document.getElementById('A').value=A;
var B = parseFloat(document.getElementById('B').value);
document.getElementById('B').value=B;
var C = parseFloat(document.getElemntById('C').value);
document.getElementById('C').value=C;
var X = C - B / A;
document.getElementById('X').value = X;
}
</script>
</head>
<body>
<input type="text" id="A"/> X + <input type="text" id="B"/> = <input type="text" id="C"/>
<br/><br/>
<button onclick="rezolvare()">Rezolvare</button> X = <input type="text" id="X" readonly="readonly"/>
</body>
</html>
In primul rand ar trebui sa stii sa rezolvi o ecuatie de gradul I inainte sa faci un script.
Formula aia nu rezolva in veci ecuatia.
In al doilea, asta nu am inteles-o:
Formula aia nu rezolva in veci ecuatia.
In al doilea, asta nu am inteles-o:
<html>
<head>
<script type="text/javascript">
function rezolvare()
{
// convertire coeficienti
var A = parseFloat(document.getElementById('A').value);
var B = parseFloat(document.getElementById('B').value);
var C = parseFloat(document.getElementById('C').value);
var X = (C - B) / A;
document.getElementById('X').value = X;
}
</script>
</head>
<body>
<input type="text" id="A"/> X + <input type="text" id="B"/> = <input type="text" id="C"/>
<br/><br/>
<button onclick="rezolvare()">Rezolvare</button> X = <input type="text" id="X" readonly="readonly"/>
</body>
</html>
<head>
<script type="text/javascript">
function rezolvare()
{
// convertire coeficienti
var A = parseFloat(document.getElementById('A').value);
var B = parseFloat(document.getElementById('B').value);
var C = parseFloat(document.getElementById('C').value);
var X = (C - B) / A;
document.getElementById('X').value = X;
}
</script>
</head>
<body>
<input type="text" id="A"/> X + <input type="text" id="B"/> = <input type="text" id="C"/>
<br/><br/>
<button onclick="rezolvare()">Rezolvare</button> X = <input type="text" id="X" readonly="readonly"/>
</body>
</html>
====================================================================================
<html>
<head>
<title>Data</title>
<script type="text/javascript">
function vftimp(i){
if(i<10){
i = "0"+i;
}
return i
}
function timp(){
var luni = new Array("Ianuarie" , "Februarie", "Martie" , "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie" , "Octombrie" , "Noiembrie" , "Decembrie");
var zile = new Array("Duminica", "Luni", "Marti", "Miercuri" , "Joi" , "Vineri" , "Sambata");
var anual = new Date();
var y = anual.getFullYear();
var m = anual.getMonth();
var d = anual.getDate();
var z = anual.getDay();
var h = anual.getHours();
var mi = anual.getMinutes();
var s = anual.getSeconds();
// punem acel 0 in fata lunilor sau zilelor < 10
m = luni[m];
d = vftimp(d);
h = vftimp(h);
mi = vftimp(mi);
s = vftimp(s);
z = zile[z];
document.getElementById('div1').innerHTML = z + ", " + d + " " + m + " " + y + ", " + h + " : "+ mi + " : " + s ;
}
</script>
</head>
<body onload="setInterval('timp()', 500);">
<div id="div1"></div>
</body>
</html>
<head>
<title>Data</title>
<script type="text/javascript">
function vftimp(i){
if(i<10){
i = "0"+i;
}
return i
}
function timp(){
var luni = new Array("Ianuarie" , "Februarie", "Martie" , "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie" , "Octombrie" , "Noiembrie" , "Decembrie");
var zile = new Array("Duminica", "Luni", "Marti", "Miercuri" , "Joi" , "Vineri" , "Sambata");
var anual = new Date();
var y = anual.getFullYear();
var m = anual.getMonth();
var d = anual.getDate();
var z = anual.getDay();
var h = anual.getHours();
var mi = anual.getMinutes();
var s = anual.getSeconds();
// punem acel 0 in fata lunilor sau zilelor < 10
m = luni[m];
d = vftimp(d);
h = vftimp(h);
mi = vftimp(mi);
s = vftimp(s);
z = zile[z];
document.getElementById('div1').innerHTML = z + ", " + d + " " + m + " " + y + ", " + h + " : "+ mi + " : " + s ;
}
</script>
</head>
<body onload="setInterval('timp()', 500);">
<div id="div1"></div>
</body>
</html>
https://github.com/google/mathsteps/issues/243
0 comentarii:
Trimiteți un comentariu