matriz cuadrada de nxn
Publicado por Xepher (2 intervenciones) el 15/09/2013 00:44:43
Recientemente me he estado aventurando un poco con javascript y html y por ocio me provocó hacer un programa que permita ingresar elementos en una matriz cuadrada de nxn y a través de una lista desplegable o varios botones se realicen las siguientes actividades: hallar el determinante de la matriz, mayor y menor elemento de la matriz, suma de la diagonal principal y la suma de todos los elementos de la matriz.
esto es lo que llevo de código:
El js:
Y el HTML:
Les agradecería mucho si me pueden ayudar. Gracias
esto es lo que llevo de código:
El js:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<html>
<head>
<script src = "ej6.js"></script>
<script>
var obj = {
init: function(){
var m = new Matrix (2);
m.showDlg();
var b = document.createElement("input");
b.type = "button";
b.value = "print";
document.body.appendChild(b);
b.onclick = function (){
m.print();
}
}
}
</script>
</head>
<body onload = "obj.init()" >
</body>
</html>
Y el HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<html>
<head>
<script src = "ej6.js"></script>
<script>
var obj = {
init: function(){
var m = new Matrix (2);
m.showDlg();
var b = document.createElement("input");
b.type = "button";
b.value = "print";
document.body.appendChild(b);
b.onclick = function (){
m.print();
}
}
}
</script>
</head>
<body onload = "obj.init()" >
</body>
</html>
Les agradecería mucho si me pueden ayudar. Gracias
Valora esta pregunta


0