Skip to content

Commit

Permalink
multiplicar y dividir
Browse files Browse the repository at this point in the history
  • Loading branch information
z3nth10n committed Jun 3, 2020
1 parent 84aa6c2 commit 2751fc3
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions operations.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
return (parseInt(n1) - parseInt(n2));
},

multiplicar: function multiplicarNumeros(n1, n2) {
return (parseInt(n1) * parseInt(n2));
},

dividir: function dividirNumeros(n1, n2) {
return (parseInt(n1) / parseInt(n2));
}


};


Expand Down Expand Up @@ -46,6 +55,14 @@
var resultado = ops.restar(num1, num2);
alert (resultado);
break;
case 'multiplicar':
var resultado = ops.multiplicar(num1, num2);
alert(resultado);
break;
case 'dividir':
var resultado = ops.dividir(num1, num2);
alert(resultado);
break;

}
}
Expand All @@ -57,16 +74,18 @@

<body>

<h1>Operations de Álvaro Rodríguez García</h1>
<h1>Operations de Álvaro Rodríguez García</h1>

<form>
Número 1: <input id="num1" type="number" />
Número 2: <input id="num2" type="number" />
<br /><br />
<input type="button" value="SUMAR" onclick="operaciones('sumar'); return false;" /><br />
<input type="button" value="RESTAR" onclick="operaciones('restar'); return false;" /><br />
<input type="button" value="MULTIPLICAR" onclick="operaciones('multiplicar'); return false;" /><br />
<input type="button" value="DIVIDIR" onclick="operaciones('dividir'); return false;" />
</form>

</body>

</html>
</html>

0 comments on commit 2751fc3

Please sign in to comment.