diff --git a/entrega/exercicio-1.js b/entrega/exercicio-1.js new file mode 100644 index 0000000..b10167b --- /dev/null +++ b/entrega/exercicio-1.js @@ -0,0 +1,10 @@ +let rainbow = [ + "Red", + "Orange", + "Blackberry", + "Blue", +]; + +rainbow.splice(2, 1, "Yellow", "Green", "Purple"); + +console.log(rainbow); \ No newline at end of file diff --git a/entrega/exercicio-2.js b/entrega/exercicio-2.js new file mode 100644 index 0000000..579a2f9 --- /dev/null +++ b/entrega/exercicio-2.js @@ -0,0 +1,5 @@ +let reverseMe = ["h", "e", "l", "l", "o"]; + +reverseMe.reverse(); + +console.log(reverseMe); diff --git a/entrega/exercicio-3.js b/entrega/exercicio-3.js new file mode 100644 index 0000000..ae0c35e --- /dev/null +++ b/entrega/exercicio-3.js @@ -0,0 +1,15 @@ +let numeros = [ 5, 3, 7, 11, 2, 25] + +function soma (array){ + + let total = 0 + +for(let index = 0; index < array.length; index++){ + total = total + array[index] + +} +return total +} + +console.log(soma(numeros)); + diff --git a/entrega/exercicio-4.js b/entrega/exercicio-4.js new file mode 100644 index 0000000..cb1a984 --- /dev/null +++ b/entrega/exercicio-4.js @@ -0,0 +1,9 @@ +let cadastroPessoa = { + + nomeCompleto: "Eliane Silva", + idade: 29, + altura: 1.67, + metrosCaminhadosDia: 15, +}; + +console.log(cadastroPessoa); diff --git a/entrega/exercicio-5.js b/entrega/exercicio-5.js new file mode 100644 index 0000000..eddaabd --- /dev/null +++ b/entrega/exercicio-5.js @@ -0,0 +1,28 @@ +let cadastroPessoa = { + nomeCompleto: "Eliane Silva", + idade: "", + altura: 1.67, + metrosCaminhadosDia: "", + + apresentação: function (years,walking){ + let idadeValidação = " ano" + if(years== 1){ + cadastroPessoa.idade += years += idadeValidação + } + else{ + idadeValidação = " anos" + cadastroPessoa.idade += years += idadeValidação + } + let metrosValidação = " metro" + if(walking == 1){ + cadastroPessoa.metrosCaminhadosDia += walking += metrosValidação + } + else{ + metrosValidação = " metros" + cadastroPessoa.metrosCaminhadosDia += walking += metrosValidação + } + return `Olá, eu sou ${cadastroPessoa.nomeCompleto}, tenho ${cadastroPessoa.idade} minha altura é ${cadastroPessoa.altura} e só hoje, eu já caminhei ${cadastroPessoa.metrosCaminhadosDia}!` + } +} + +console.log(cadastroPessoa.apresentação(29, 15)) \ No newline at end of file