From 6b03bde6ba6fad4de137d62a4c36442b77f93774 Mon Sep 17 00:00:00 2001 From: roshka Date: Thu, 11 Oct 2018 17:00:51 -0300 Subject: [PATCH] Ejercicio de JS --- .#Cuestionario.txt | 1 + Ejercicio.html | 10 ++++++++++ Home.js | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 120000 .#Cuestionario.txt create mode 100644 Ejercicio.html create mode 100644 Home.js diff --git a/.#Cuestionario.txt b/.#Cuestionario.txt new file mode 120000 index 0000000..4265e68 --- /dev/null +++ b/.#Cuestionario.txt @@ -0,0 +1 @@ +roshka@rshkbootcampws.roshka.com.py.1966:1539268254 \ No newline at end of file diff --git a/Ejercicio.html b/Ejercicio.html new file mode 100644 index 0000000..317e89e --- /dev/null +++ b/Ejercicio.html @@ -0,0 +1,10 @@ + + + + Ejercicios + + +

Ecuaciones

+ + + \ No newline at end of file diff --git a/Home.js b/Home.js new file mode 100644 index 0000000..d3a9be2 --- /dev/null +++ b/Home.js @@ -0,0 +1,70 @@ +let x = 10; +let y = 5; +let aux; + +console.log("Suma: "+(x+y)); +console.log("Resta: "+(x-y)); +console.log("Multiplicacion: "+(x*y)); +console.log("Division: "+(x/y)); +console.log("Potencia: "+(x**y)); +console.log("Resto de la Division: "+(x%y)); + +console.log("-----------------------"); + +let valor1 = 1; +let valor2 = 5; +let valor3 = -8; +let valor4 = 2; +let valor5 = -8; +let valor6 = 15; +let valor7 = 10; +let valor8 = 20; +let valor9 = 9; + +let positivo1 = ((-valor2)+(((valor2**2)-(4*valor1*valor3))**0.5)) / (2*valor1); +let negativo1 = ((-valor2)-(((valor2**2)-(4*valor1*valor3))**0.5)) / (2*valor1); +let positivo2 = ((-valor5)+(((valor5**2)-(4*valor4*valor6))**0.5)) / (2*valor3); +let negativo2 = ((-valor5)-(((valor5**2)-(4*valor4*valor6))**0.5)) / (2*valor3); +let positivo3 = ((-valor8)+(((valor8**2)-(4*valor7*valor9))**0.5)) / (2*valor7); +let negativo3 = ((-valor8)-(((valor8**2)-(4*valor7*valor9))**0.5)) / (2*valor7); + +console.log("Ecuaciones Cuadraticas:"); +console.log("x^2 + 5x - 8 = 0"); + +if (positivo1 > 0) { + console.log(positivo1); + console.log(negativo1); +}else{ + console.log("No se puede resolver") +} +console.log("2x^2 - 8x + 15 = 0"); +if (((valor5**2)-(4*valor4*valor6)) > 0) { + console.log(positivo2); + console.log(negativo2); +}else{ + console.log("No se puede resolver") +} +console.log("10x^2 + 20x + 9 = 0"); +if (positivo3 > 0) { + console.log(positivo3); + console.log(negativo3); +}else{ + console.log("No se puede resolver") +} + + +console.log("-------------------------------------") + +let resultado1 = Math.sin(120) - Math.cos(60); +let resultado2 = (Math.sin(90)**2) * (Math.cos(10)**2); +console.log("Resultado 1: "+resultado1); +console.log("Resultado 2: "+resultado2); + + +console.log("-------------------------------------") +//Para crear un objeto String +String = new String("Objeto"); +console.log(String); +//Para crear una cadena primitiva +s_primitivo = String("Primitivo"); +console.log(String); \ No newline at end of file -- libgit2 0.26.0