Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signing in to GitHub #201

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added 01-Git/.DS_Store
Binary file not shown.
Binary file added 02-JS-I/.DS_Store
Binary file not shown.
Binary file added 02-JS-I/homework/.DS_Store
Binary file not shown.
115 changes: 70 additions & 45 deletions 02-JS-I/homework/homework.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// En estas primeras 6 preguntas, reemplaza `null` por la respuesta

// Crea una variable "string", puede contener lo que quieras:
const nuevaString = null;
const nuevaString = "Paula";

// Crea una variable numérica, puede ser cualquier número:
const nuevoNum = null;
const nuevoNum = 43;

// Crea una variable booleana:
const nuevoBool = null;
const nuevoBool = false;

// Resuelve el siguiente problema matemático:
const nuevaResta = 10 - null === 5;
const nuevaResta = 10 - 5 === 5;

// Resuelve el siguiente problema matemático:
const nuevaMultiplicacion = 10 * null === 40 ;
const nuevaMultiplicacion = 10 * 4 === 40 ;

// Resuelve el siguiente problema matemático:
const nuevoModulo = 21 % 5 === null;
const nuevoModulo = 21 % 5 === 1;


// En los próximos 22 problemas, deberás completar la función.
Expand All @@ -28,173 +28,192 @@ const nuevoModulo = 21 % 5 === null;
function devolverString(str) {
// "Return" la string provista: str
// Tu código:

return str
}

function suma(x, y) {
// "x" e "y" son números
// Suma "x" e "y" juntos y devuelve el valor
// Tu código:

return x + y ;
}

function resta(x, y) {
// Resta "y" de "x" y devuelve el valor
// Tu código:

return x - y
}

function multiplica(x, y) {
// Multiplica "x" por "y" y devuelve el valor
// Tu código:

return x * y
}

function divide(x, y) {
// Divide "x" entre "y" y devuelve el valor
// Tu código:

return x / y
}

function sonIguales(x, y) {
// Devuelve "true" si "x" e "y" son iguales
// De lo contrario, devuelve "false"
// Tu código:
if (x === y) {

}
return true
} {
return false
}}


function tienenMismaLongitud(str1, str2) {
// Devuelve "true" si las dos strings tienen la misma longitud
// De lo contrario, devuelve "false"
// Tu código:

}
if (str1.length === str2.length)
{ return true }
return false }

function menosQueNoventa(num) {
// Devuelve "true" si el argumento de la función "num" es menor que noventa
// De lo contrario, devuelve "false"
// Tu código:

if (num < 90) {
return true
} return false
}

function mayorQueCincuenta(num) {
// Devuelve "true" si el argumento de la función "num" es mayor que cincuenta
// De lo contrario, devuelve "false"
// Tu código:

// Tu código: (15)
if (num > 50) {
return true
}
return false
}

function obtenerResto(x, y) {
// Obten el resto de la división de "x" entre "y"
// Tu código:
return x % y
}

function esPar(num) {
// Devuelve "true" si "num" es par
// De lo contrario, devuelve "false"
// Tu código:

// Tu código: (17)
if (num % 2 === 0) {
return true
} return false
}

function esImpar(num) {
// Devuelve "true" si "num" es impar
// De lo contrario, devuelve "false"
// Tu código:

// Tu código: (18)
if (num %2 !== 0) {
return true
} return false
}

function elevarAlCuadrado(num) {
// Devuelve el valor de "num" elevado al cuadrado
// ojo: No es raiz cuadrada!
// Tu código:

// Tu código: (19)
return num * num
}

function elevarAlCubo(num) {
// Devuelve el valor de "num" elevado al cubo
// Tu código:

return Math.pow(num,3)
}

function elevar(num, exponent) {
// Devuelve el valor de "num" elevado al exponente dado en "exponent"
// Tu código:

// Tu código: (21)
return Math.pow(num,exponent)
}

function redondearNumero(num) {
// Redondea "num" al entero más próximo y devuélvelo
// Tu código:
return Math.round(num)
}

function redondearHaciaArriba(num) {
// Redondea "num" hacia arriba (al próximo entero) y devuélvelo
// Tu código:

// Tu código: (23)
return Math.ceil(num)
}

function numeroRandom() {
//Generar un número al azar entre 0 y 1 y devolverlo
//Pista: investigá qué hace el método Math.random()

//Pista: investigá qué hace el método Math.random() (24)
return Math.random()
}

function esPositivo(numero) {
//La función va a recibir un entero. Devuelve como resultado una cadena de texto que indica si el número es positivo o negativo.
//Si el número es positivo, devolver ---> "Es positivo"
//Si el número es negativo, devolver ---> "Es negativo"
//Si el número es 0, devuelve false

//Si el número es 0, devuelve false (25)
if (numero === 0) return false;
else if (numero > 0) {
return "Es positivo";
} return "Es negativo"
}

function agregarSimboloExclamacion(str) {
// Agrega un símbolo de exclamación al final de la string "str" y devuelve una nueva string
// Ejemplo: "hello world" pasaría a ser "hello world!"
// Tu código:
// Tu código: (26)
return (str) + "!"
}

function combinarNombres(nombre, apellido) {
// Devuelve "nombre" y "apellido" combinados en una string y separados por un espacio.
// Ejemplo: "Soy", "Henry" -> "Soy Henry"
// Tu código:

return (nombre) + " " + (apellido)
}

function obtenerSaludo(nombre) {
// Toma la string "nombre" y concatena otras string en la cadena para que tome la siguiente forma:
// "Martin" -> "Hola Martin!"
// Tu código:

// Tu código: (28)
return "Hola " + (nombre) + "!"
}

function obtenerAreaRectangulo(alto, ancho) {
// Retornar el area de un rectángulo teniendo su altura y ancho
// Tu código:

return (alto * ancho)
}


function retornarPerimetro(lado){
//Escibe una función a la cual reciba el valor del lado de un cuadrado y retorne su perímetro.
//Escribe tu código aquí

//Escribe tu código aquí (30)
return lado + lado + lado + lado
}


function areaDelTriangulo(base, altura){
//Desarrolle una función que calcule el área de un triángulo.
//Escribe tu código aquí

return ( base * altura) / 2
}


function deEuroAdolar(euro){
//Supongamos que 1 euro equivale a 1.20 dólares. Escribe un programa que reciba
//como parámetro un número de euros y calcule el cambio en dólares.
//Escribe tu código aquí

//Escribe tu código aquí (32)
return euro * 1.20
}


Expand All @@ -203,8 +222,14 @@ function esVocal(letra){
//Verificar si el usuario ingresó un string de más de un carácter, en ese caso, informarle
//que no se puede procesar el dato mediante el mensaje "Dato incorrecto".
// Si no es vocal, tambien debe devolver "Dato incorrecto".
//Escribe tu código aquí
//Escribe tu código aquí (33)
if (letra.length > 1) {
return "Dato incorrecto"
}
else if (letra === "a"|| letra === "e" || letra === "i" || letra === "o" || letra === "u")
{ return "Es vocal" }

{ return "Dato incorrecto"}
}


Expand Down
3 changes: 3 additions & 0 deletions 02-JS-I/homework/prueba.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let count = 50
count = count + 50
console.log(count)
Loading