diff --git a/entrega/exerc1.js b/entrega/exerc1.js new file mode 100644 index 0000000..e816d66 --- /dev/null +++ b/entrega/exerc1.js @@ -0,0 +1,7 @@ +let rainbow = ["Red", "Orange", "Blackberry", "Blue"]; +rainbow.splice(2, 1, "Yelloow", "Green") +rainbow.splice(5, 1, "Purple") + +console.log(rainbow) + + \ No newline at end of file diff --git a/entrega/exerc2.js b/entrega/exerc2.js new file mode 100644 index 0000000..ce2294a --- /dev/null +++ b/entrega/exerc2.js @@ -0,0 +1,4 @@ +let reverseMe = ["h","e", "l", "l", "o"]; + +console.log(reverseMe.reverse()) + diff --git a/entrega/exerc3.js b/entrega/exerc3.js new file mode 100644 index 0000000..485d400 --- /dev/null +++ b/entrega/exerc3.js @@ -0,0 +1,12 @@ +let soma = [1, 2, 3, 4, 5]; + +function somatoria(array) { + let resultado = 0; + for(let index = 0; index < array.length; index++){ + + resultado += array[index]; + } + + console.log(resultado); +} + somatoria(soma); \ No newline at end of file diff --git a/entrega/exerc4.js b/entrega/exerc4.js new file mode 100644 index 0000000..ba2a724 --- /dev/null +++ b/entrega/exerc4.js @@ -0,0 +1,16 @@ +const readlineSync = require("readline-sync"); + +let pessoa = { + nome: "", + idade: "", + altura: "", + metrosCaminhadosDia: "", +} + +pessoa.nome = readlineSync.question("Digite seu nome:"); +pessoa.idade = readlineSync.question("Digite a sua idade:"); +pessoa.altura = readlineSync.question("Digite a sua altura:"); +pessoa.metrosCaminhadosDia = readlineSync.question("Quantos metros voce caminhou hoje?"); + + +console.log(pessoa); \ No newline at end of file diff --git a/entrega/exerc5.js b/entrega/exerc5.js new file mode 100644 index 0000000..8f408a7 --- /dev/null +++ b/entrega/exerc5.js @@ -0,0 +1,14 @@ +const readlineSync = require("readline-sync"); + +let pessoa = { + +nome: "Camila", +idade: "32", +altura: "1.45", +metrosCaminhadosDia: "1000", +apresentaçao: function descriçao () { + return `Olá, eu sou ${pessoa.nome}, tenho ${pessoa.idade} anos, minha altura é ${pessoa.altura} e só hoje, eu já caminhei ${pessoa.metrosCaminhadosDia} metros.` +} + +} +console.log(pessoa.apresentaçao()); \ No newline at end of file