From e16c751888640d0b368e3cbc2176db376b57718b Mon Sep 17 00:00:00 2001 From: FelipeAssis27 Date: Fri, 26 Feb 2021 19:51:32 -0300 Subject: [PATCH 1/3] =?UTF-8?q?subindo=20exercicios=20do=203=C2=BA=20dia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fundamentos_web/bloco_2/2.1/README.md | 1 + fundamentos_web/bloco_2/2.1/trybe_skills.txt | 6 +++ fundamentos_web/bloco_3/dia_1 | 1 + .../bloco_3/dia_3/.vscode/settings.json | 3 ++ fundamentos_web/bloco_3/dia_3/ag_pseudo1.html | 37 ++++++++++++++ fundamentos_web/bloco_3/dia_3/ag_pseudo2.html | 42 +++++++++++++++ fundamentos_web/bloco_3/dia_3/index.html | 15 ++++++ fundamentos_web/bloco_3/dia_3/index3.html | 46 +++++++++++++++++ .../dia_3/posicionamento_elementos.html | 25 +++++++++ fundamentos_web/bloco_3/dia_3/style.css | 27 ++++++++++ fundamentos_web/bloco_3/dia_3/style2.css | 16 ++++++ fundamentos_web/bloco_3/dia_3/style3.css | 51 +++++++++++++++++++ .../bloco_3/dia_3/style_index3.css | 36 +++++++++++++ .../bloco_3/dia_3/style_position.css | 42 +++++++++++++++ .../bloco_3/dia_4/block_inline.css | 37 ++++++++++++++ .../bloco_3/dia_4/elemnts_block_inline.html | 39 ++++++++++++++ fundamentos_web/bloco_4/dia_2 | 1 + .../bonus5.js | 18 +++++++ .../bonus6.js | 10 ++++ .../ex1.js | 13 +++++ .../ex2.js | 8 +++ .../ex3.js | 17 +++++++ .../ex4.js | 24 +++++++++ fundamentos_web/bloco_4/javascript1.js | 9 ++++ fundamentos_web/bloco_4/javascript2.js | 12 +++++ fundamentos_web/bloco_4/javascript3.js | 6 +++ fundamentos_web/bloco_4/javascript4.js | 10 ++++ fundamentos_web/bloco_4/javascript5.js | 12 +++++ 28 files changed, 564 insertions(+) create mode 100644 fundamentos_web/bloco_2/2.1/README.md create mode 100644 fundamentos_web/bloco_2/2.1/trybe_skills.txt create mode 160000 fundamentos_web/bloco_3/dia_1 create mode 100644 fundamentos_web/bloco_3/dia_3/.vscode/settings.json create mode 100644 fundamentos_web/bloco_3/dia_3/ag_pseudo1.html create mode 100644 fundamentos_web/bloco_3/dia_3/ag_pseudo2.html create mode 100644 fundamentos_web/bloco_3/dia_3/index.html create mode 100644 fundamentos_web/bloco_3/dia_3/index3.html create mode 100644 fundamentos_web/bloco_3/dia_3/posicionamento_elementos.html create mode 100644 fundamentos_web/bloco_3/dia_3/style.css create mode 100644 fundamentos_web/bloco_3/dia_3/style2.css create mode 100644 fundamentos_web/bloco_3/dia_3/style3.css create mode 100644 fundamentos_web/bloco_3/dia_3/style_index3.css create mode 100644 fundamentos_web/bloco_3/dia_3/style_position.css create mode 100644 fundamentos_web/bloco_3/dia_4/block_inline.css create mode 100644 fundamentos_web/bloco_3/dia_4/elemnts_block_inline.html create mode 160000 fundamentos_web/bloco_4/dia_2 create mode 100644 fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/bonus5.js create mode 100644 fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/bonus6.js create mode 100644 fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/ex1.js create mode 100644 fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/ex2.js create mode 100644 fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/ex3.js create mode 100644 fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/ex4.js create mode 100644 fundamentos_web/bloco_4/javascript1.js create mode 100644 fundamentos_web/bloco_4/javascript2.js create mode 100644 fundamentos_web/bloco_4/javascript3.js create mode 100644 fundamentos_web/bloco_4/javascript4.js create mode 100644 fundamentos_web/bloco_4/javascript5.js diff --git a/fundamentos_web/bloco_2/2.1/README.md b/fundamentos_web/bloco_2/2.1/README.md new file mode 100644 index 0000000..2e0961b --- /dev/null +++ b/fundamentos_web/bloco_2/2.1/README.md @@ -0,0 +1 @@ +Ferramentas a serem dominadas diff --git a/fundamentos_web/bloco_2/2.1/trybe_skills.txt b/fundamentos_web/bloco_2/2.1/trybe_skills.txt new file mode 100644 index 0000000..5d0297d --- /dev/null +++ b/fundamentos_web/bloco_2/2.1/trybe_skills.txt @@ -0,0 +1,6 @@ +O que eu vou aprender na Trybe: +-Unix +-Bash +-Git +-HTML +-CSS diff --git a/fundamentos_web/bloco_3/dia_1 b/fundamentos_web/bloco_3/dia_1 new file mode 160000 index 0000000..6498b63 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_1 @@ -0,0 +1 @@ +Subproject commit 6498b638e6a843502f411ead33ab14da97a81dca diff --git a/fundamentos_web/bloco_3/dia_3/.vscode/settings.json b/fundamentos_web/bloco_3/dia_3/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/fundamentos_web/bloco_3/dia_3/ag_pseudo1.html b/fundamentos_web/bloco_3/dia_3/ag_pseudo1.html new file mode 100644 index 0000000..df61e74 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/ag_pseudo1.html @@ -0,0 +1,37 @@ + + + + + Agrupando Seletores + + + +

Lista dos Melhores Sites que já vi

+

Top 3 dos melhores sites que existem na web

+
    +
  1. https://www.betrybe.com/
  2. +
  3. https://www.w3schools.com/
  4. +
  5. https://css-tricks.com/
  6. +
+ +

Principais motivos para eu gostar deles

+ + + + \ No newline at end of file diff --git a/fundamentos_web/bloco_3/dia_3/ag_pseudo2.html b/fundamentos_web/bloco_3/dia_3/ag_pseudo2.html new file mode 100644 index 0000000..1d263f7 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/ag_pseudo2.html @@ -0,0 +1,42 @@ + + + + + Pseudoclasses + + + +

Paleta de Cores

+

Vamos criar uma paleta de cores com as divs abaixo:

+
+ +
+

Cor primária

+
+
+

Cor Secundária

+
+
+

Cor Complementar

+
+
+

Cor Escura

+
+
+

Cor Clara

+
+ +
+ + + + + \ No newline at end of file diff --git a/fundamentos_web/bloco_3/dia_3/index.html b/fundamentos_web/bloco_3/dia_3/index.html new file mode 100644 index 0000000..434fc60 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/index.html @@ -0,0 +1,15 @@ + + + + + + Exercício de Fixação: box model + + + +
A
+
B
+
C
+
D
+ + \ No newline at end of file diff --git a/fundamentos_web/bloco_3/dia_3/index3.html b/fundamentos_web/bloco_3/dia_3/index3.html new file mode 100644 index 0000000..de1c556 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/index3.html @@ -0,0 +1,46 @@ + + + + + + #GoTrybe + + +

Combinações e Classes Descendentes

+
+

Top 5 frases memoráveis:

+
    +
  1. Com grandes poderes vêm grandes responsabilidades. - Tio Ben (Homem Aranha)
  2. +
  3. Houston, temos um problema. - Jack Swigert
  4. +
  5. Sempre parece impossível até que esteja feito. - Nelson Mandela
  6. +
  7. Parte da jornada é o fim. - Tony Stark (Homem de Ferro)
  8. +
  9. Às vezes, o melhor que podemos fazer é começar novamente. - Steve Rogers (Capitão América)
  10. +
+

As maiores linguagens de programação:

+ +

Maiores aliados de uma pessoa desenvolvedora:

+ + + \ No newline at end of file diff --git a/fundamentos_web/bloco_3/dia_3/posicionamento_elementos.html b/fundamentos_web/bloco_3/dia_3/posicionamento_elementos.html new file mode 100644 index 0000000..3309b00 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/posicionamento_elementos.html @@ -0,0 +1,25 @@ + + + + + Posicionamento de elementos + + + +

Exercícios de fixação 3.3

+ jumpMario + gomba +

+ Goomba, do something! +

+ baloon + bowser + + + + \ No newline at end of file diff --git a/fundamentos_web/bloco_3/dia_3/style.css b/fundamentos_web/bloco_3/dia_3/style.css new file mode 100644 index 0000000..889f16a --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/style.css @@ -0,0 +1,27 @@ +.caixa { + color: white; + display: inline-block; + line-height: 50px; + text-align: center; + vertical-align: top; + } + + .width-and-height { + height: 50px; + width: 50px; + } + + .padding { + padding: 20px; + /* insira aqui um padding de 20px na classe abaixo para aplicá-lo aos itens B, C e D */ + } + + .margin { + margin: 30px ; + /* insira aqui uma margem de 30px na classe abaixo para aplicá-la aos itens C e D */ + } + + .border { + border: 5px solid black; + /* insira aqui uma borda com valor '5px solid black' para aplicá-la ao item D */ + } \ No newline at end of file diff --git a/fundamentos_web/bloco_3/dia_3/style2.css b/fundamentos_web/bloco_3/dia_3/style2.css new file mode 100644 index 0000000..e7ceb40 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/style2.css @@ -0,0 +1,16 @@ +h1, p { + text-align: center; +} +ol { + background-color: cornsilk; + color: darkgray; +} +li:hover { + background-color: darksalmon; +} +li:active { + color: dodgerblue; +} +ol, ul { + list-style: none; +} diff --git a/fundamentos_web/bloco_3/dia_3/style3.css b/fundamentos_web/bloco_3/dia_3/style3.css new file mode 100644 index 0000000..2a92663 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/style3.css @@ -0,0 +1,51 @@ +h1 { + font-family: 'Lucida Sans'; + font-size: 50px; + text-align: center; + color: gray; +} +div:nth-child(1) { + background-color: rgb(86, 170, 47); + width: 100%; + display: inline-block; + z-index: 2; +} +div:nth-child(2) { + background-color: rgb(2, 201, 85); + width: 100%; + display: inline-block; + z-index: 3; +} +div:nth-child(3) { + background-color: rgb(92, 177, 123); + width: 100%; + height:160px; + display: inline-block; + z-index: 0; +} +div:nth-child(4) { + background-color: rgb(8, 39, 2); + width: 100%; + display: inline-block; + z-index: 4; +} +div:nth-child(5) { + background-color: rgb(209, 241, 183); + width: 100%; + display: inline-block; + z-index: 5; +} +div:hover { + border-style: ridge; +} +h3 { + font-family: Impact; + font-style: normal; + font-size: 35px; + font-weight:bold; + margin-left: 10px; + color: rgb(97, 95, 95); +} +h3.odd { + font-style: italic; +} diff --git a/fundamentos_web/bloco_3/dia_3/style_index3.css b/fundamentos_web/bloco_3/dia_3/style_index3.css new file mode 100644 index 0000000..fcab9a2 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/style_index3.css @@ -0,0 +1,36 @@ +ol { + background-color: rgb(212, 196, 104); +} +ol li:nth-child(2n) { + color:teal; +} +ol li.nprimos { + text-transform: uppercase; +} +h1, h3 { + color: tomato; +} +h1 { + text-align: center; + font-size: 40px; + border-style: solid; + border-color: black; + border-width: 1px; +} +li { + font-size: 20px; +} +em { + font-weight: bold; +} +#python { + color: rgb(76, 76, 207); +} +ul li.java { + color: rgb(76, 76, 207); + background-color:fuchsia; +} +ul li a:hover { + color: darksalmon; + font-weight: bolder; +} diff --git a/fundamentos_web/bloco_3/dia_3/style_position.css b/fundamentos_web/bloco_3/dia_3/style_position.css new file mode 100644 index 0000000..a3248b6 --- /dev/null +++ b/fundamentos_web/bloco_3/dia_3/style_position.css @@ -0,0 +1,42 @@ +h1 { + text-align: center; +} +.super-mario { + width: 300px; + position: absolute; + z-index:2; + margin-top: 100px; + left: 200px; + +} +.goomba { + width: 300px; + position: absolute; + z-index: 1; + left: 400px; + margin-top: 450px; + margin-left: 250px; +} +.word { + width: 150px; + position:absolute; + z-index: 5; + float: right; + right: 560px; + margin-top: 225px; + +} +.bowser { + width: 300px; + position: absolute; + right: 200px; + z-index: 4; + margin-top: 200px; + +} +.baloon { + position: absolute; + z-index: 3; + margin-top: 170px; + right: 520px; +} \ No newline at end of file diff --git a/fundamentos_web/bloco_3/dia_4/block_inline.css b/fundamentos_web/bloco_3/dia_4/block_inline.css new file mode 100644 index 0000000..55c1ccc --- /dev/null +++ b/fundamentos_web/bloco_3/dia_4/block_inline.css @@ -0,0 +1,37 @@ +body { + text-align: center; +} +h1 { + text-align: center; +} +.podium { + display: inline; + align-items: center; + text-align: center; + list-style-type: none; +} +.first { + background-color: rgb(235, 200, 84); + font-size: 20px; + height: 50px; + width: 16%; + margin-left: 42%; +} +.second { + background-color: rgb(219, 219, 219); + font-size: 20px; + height: 50px; + width: 20%; + display: inline-block; +} +.third { + background-color: rgb(170, 142, 106); + font-size: 20px; + height: 50px; + width: 20%; + display: inline-block; +} +ul { + list-style-type: none; +} + diff --git a/fundamentos_web/bloco_3/dia_4/elemnts_block_inline.html b/fundamentos_web/bloco_3/dia_4/elemnts_block_inline.html new file mode 100644 index 0000000..92c899a --- /dev/null +++ b/fundamentos_web/bloco_3/dia_4/elemnts_block_inline.html @@ -0,0 +1,39 @@ + + + + + + + Ranking + + + +
+

Hackathon Results

+
+
+ +
+
+

Premiação Primeiro Lugar:

+ +

Premiação Segundo Lugar:

+ +

Premiação Terceiro Lugar:

+ +
+ + \ No newline at end of file diff --git a/fundamentos_web/bloco_4/dia_2 b/fundamentos_web/bloco_4/dia_2 new file mode 160000 index 0000000..47ebbfd --- /dev/null +++ b/fundamentos_web/bloco_4/dia_2 @@ -0,0 +1 @@ +Subproject commit 47ebbfd83bc6fec0b9fe459c8fc738ada3b07cfc diff --git a/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/bonus5.js b/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/bonus5.js new file mode 100644 index 0000000..2dd8118 --- /dev/null +++ b/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/bonus5.js @@ -0,0 +1,18 @@ +let n = 11; +let middle = (n + 1) / 2; +let controlLeft = middle; +let controlRight = middle; +let symbol = '*'; +for (let line = 1; line <= middle; line += 1) { + let outputLine = ''; + for (let col = 1; col <= n; col += 1) { + if (col == controlLeft || col == controlRight || line == middle) { + outputLine += symbol; + } else { + outputLine += ' '; + } + } + controlLeft -= 1; + controlRight += 1; + console.log(outputLine); +} \ No newline at end of file diff --git a/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/bonus6.js b/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/bonus6.js new file mode 100644 index 0000000..6e741e3 --- /dev/null +++ b/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/bonus6.js @@ -0,0 +1,10 @@ + +let divisors = 1; +let numberToCheck = 674567; + +for (let number = 2; number <= numberToCheck; number += 1) { + if (numberToCheck % number === 0) divisors += 1; +} + +if (divisors === 2) console.log(numberToCheck + ' é primo'); +else console.log(numberToCheck + ' não é primo'); \ No newline at end of file diff --git a/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/ex1.js b/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/ex1.js new file mode 100644 index 0000000..2acafb0 --- /dev/null +++ b/fundamentos_web/bloco_4/exercises/introducao-a-javascript-e-logica-de-programacao_3/ex1.js @@ -0,0 +1,13 @@ +let n = 4; +let lado = "*"; +let linha = " "; + +for (i=0; i controlRight && lineColumn < controlLeft) { + lineInput = lineInput + symbol; + } else { + lineInput = lineInput + ' '; + } + } + console.log(lineInput); + lineInput = ''; + controlRight -= 1; + controlLeft += 1; +}; \ No newline at end of file diff --git a/fundamentos_web/bloco_4/javascript1.js b/fundamentos_web/bloco_4/javascript1.js new file mode 100644 index 0000000..ee256c1 --- /dev/null +++ b/fundamentos_web/bloco_4/javascript1.js @@ -0,0 +1,9 @@ +const nome = "FelipeAssis"; +const birthCity = "Belo Horizonte"; +let birthYear = "1981"; +birthCity = "Nazaré"; +birthYear = "2020"; +console.log(nome); +console.log(birthCity); +console.log(birthYear); + diff --git a/fundamentos_web/bloco_4/javascript2.js b/fundamentos_web/bloco_4/javascript2.js new file mode 100644 index 0000000..03eb78e --- /dev/null +++ b/fundamentos_web/bloco_4/javascript2.js @@ -0,0 +1,12 @@ +let patientId = '50'; +let isEnrolled = true; +const patientInfo = { + firstName: 'Ana', + lastName: 'Santos', +}; +const patientEmail = 'ana@email.com'; +console.log(typeof patientId); +console.log(typeof isEnrolled); +console.log(typeof patientInfo); +console.log(typeof patientEmail); +console.log(typeof patientAge); diff --git a/fundamentos_web/bloco_4/javascript3.js b/fundamentos_web/bloco_4/javascript3.js new file mode 100644 index 0000000..d66a103 --- /dev/null +++ b/fundamentos_web/bloco_4/javascript3.js @@ -0,0 +1,6 @@ +let base = 5; +let altura = 8; +let area = base * altura; +console.log(area); +let perimetro = base*2 + altura*2; +console.log(perimetro); \ No newline at end of file diff --git a/fundamentos_web/bloco_4/javascript4.js b/fundamentos_web/bloco_4/javascript4.js new file mode 100644 index 0000000..3c8579c --- /dev/null +++ b/fundamentos_web/bloco_4/javascript4.js @@ -0,0 +1,10 @@ +let notaCandidato = 38; +if (notaCandidato >= 60 && notaCandidato<= 80) { + console.log("Você está em nossa lista de espera."); +} +else if (notaCandidato > 80) { + console.log ("Parabéns! Você está aprovado!"); +} +else { + console.log("Você foi reprovado."); +} diff --git a/fundamentos_web/bloco_4/javascript5.js b/fundamentos_web/bloco_4/javascript5.js new file mode 100644 index 0000000..4e6e795 --- /dev/null +++ b/fundamentos_web/bloco_4/javascript5.js @@ -0,0 +1,12 @@ +let situacaoCandidato = "não inscrito"; +switch (situacaoCandidato) { + case "aprovado": + console.log("aprovada"); + break; + + case "reprovado": + console.log("reprovada"); + + default: + console.log("não se aplica"); +} \ No newline at end of file From 276f05b3e5d77073713f204d459ee1e22c406844 Mon Sep 17 00:00:00 2001 From: FelipeAssis27 Date: Tue, 2 Mar 2021 16:00:28 -0300 Subject: [PATCH 2/3] exercicios bloco 4 - dia 4 --- fundamentos_web/bloco_4/dia_4/ex2_js_for_loops.js | 5 +++++ fundamentos_web/bloco_4/dia_4/function.js | 11 +++++++++++ fundamentos_web/bloco_4/dia_4/function2.js | 6 ++++++ fundamentos_web/bloco_4/dia_4/player.js | 12 ++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 fundamentos_web/bloco_4/dia_4/ex2_js_for_loops.js create mode 100644 fundamentos_web/bloco_4/dia_4/function.js create mode 100644 fundamentos_web/bloco_4/dia_4/function2.js create mode 100644 fundamentos_web/bloco_4/dia_4/player.js diff --git a/fundamentos_web/bloco_4/dia_4/ex2_js_for_loops.js b/fundamentos_web/bloco_4/dia_4/ex2_js_for_loops.js new file mode 100644 index 0000000..aa6bff2 --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/ex2_js_for_loops.js @@ -0,0 +1,5 @@ +let cars = ["Saab", "Volvo", "BMW"]; + +for (let i in cars) { + console.log(cars[i]); +} \ No newline at end of file diff --git a/fundamentos_web/bloco_4/dia_4/function.js b/fundamentos_web/bloco_4/dia_4/function.js new file mode 100644 index 0000000..4f70160 --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/function.js @@ -0,0 +1,11 @@ +function area(base, altura) { + return base * altura; +}; + +function perimetro (base, altura) { + return base*2 + altura*2; +}; + + +console.log(area(8,10)); +console.log(perimetro(8,10)); diff --git a/fundamentos_web/bloco_4/dia_4/function2.js b/fundamentos_web/bloco_4/dia_4/function2.js new file mode 100644 index 0000000..13b3a57 --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/function2.js @@ -0,0 +1,6 @@ +let firstNumber = Math.ceil(Math.random() * 60); +let secondNumber = Math.ceil(Math.random() * 60); +let megaSenaNumbers = []; + +megaSenaNumbers.push(firstNumber, secondNumber); +console.log(megaSenaNumbers); diff --git a/fundamentos_web/bloco_4/dia_4/player.js b/fundamentos_web/bloco_4/dia_4/player.js new file mode 100644 index 0000000..c19fddc --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/player.js @@ -0,0 +1,12 @@ +let player = { + name: "Marta", + lastName: "Silva", + age: 34, + medals: {golden: 2, + silver: 3}, + bestInTheWorld: [2006, 2007, 2008, 2009, 2010, 2018] +}; + +console.log("A jogadora " + player['name'] + " " + player['lastName'] + " " + "tem" + " " + player['age'] + " " + "anos de idade."); +console.log("A jogadora " + player.name + " " + player.lastName + " " + "foi eleita a melhor do mundo por seis vezes: " + player.bestInTheWorld + "."); +console.log("A jogadora possui " + player.medals.golden + " " + "medalhas de ouro e " + player.medals.silver + " " + "medalhas de prata."); \ No newline at end of file From 6a35b0ee055f87788ec7aa351593b50744f4044d Mon Sep 17 00:00:00 2001 From: FelipeAssis27 Date: Tue, 2 Mar 2021 16:04:18 -0300 Subject: [PATCH 3/3] =?UTF-8?q?subindo=20vers=C3=A3o=20correta=20dos=20exe?= =?UTF-8?q?rcicios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fundamentos_web/bloco_4/dia_4/bonus1.js | 27 ++++++++ fundamentos_web/bloco_4/dia_4/bonus2.js | 25 +++++++ fundamentos_web/bloco_4/dia_4/end_word.js | 13 ++++ fundamentos_web/bloco_4/dia_4/exercicio1.js | 32 +++++++++ fundamentos_web/bloco_4/dia_4/function.js | 2 + fundamentos_web/bloco_4/dia_4/function2.js | 48 ++++++++++++-- fundamentos_web/bloco_4/dia_4/maior_nome.js | 22 +++++++ fundamentos_web/bloco_4/dia_4/maior_valor.js | 24 +++++++ fundamentos_web/bloco_4/dia_4/menor_valor.js | 12 ++++ fundamentos_web/bloco_4/dia_4/palindromo.js | 23 +++++++ fundamentos_web/bloco_4/dia_4/repetido.js | 68 ++++++++++++++++++++ fundamentos_web/bloco_4/dia_4/somatorio.js | 8 +++ 12 files changed, 298 insertions(+), 6 deletions(-) create mode 100644 fundamentos_web/bloco_4/dia_4/bonus1.js create mode 100644 fundamentos_web/bloco_4/dia_4/bonus2.js create mode 100644 fundamentos_web/bloco_4/dia_4/end_word.js create mode 100644 fundamentos_web/bloco_4/dia_4/exercicio1.js create mode 100644 fundamentos_web/bloco_4/dia_4/maior_nome.js create mode 100644 fundamentos_web/bloco_4/dia_4/maior_valor.js create mode 100644 fundamentos_web/bloco_4/dia_4/menor_valor.js create mode 100644 fundamentos_web/bloco_4/dia_4/palindromo.js create mode 100644 fundamentos_web/bloco_4/dia_4/repetido.js create mode 100644 fundamentos_web/bloco_4/dia_4/somatorio.js diff --git a/fundamentos_web/bloco_4/dia_4/bonus1.js b/fundamentos_web/bloco_4/dia_4/bonus1.js new file mode 100644 index 0000000..573444e --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/bonus1.js @@ -0,0 +1,27 @@ +function Algarismos(string) { + let algarismos = { + I: 1, + V: 5, + X: 10, + L: 50, + C: 100, + D: 500, + M: 1000, + }; + let arrayNumbers = []; + let result = 0; + + for (let indice in string) { + arrayNumbers[indice] = algarismos[string[indice]]; + } + + for (let indice in arrayNumbers) { + if (arrayNumbers[indice] < arrayNumbers[indice + 1]) { + arrayNumbers[indice + 1] = arrayNumbers[indice + 1] - arrayNumbers[indice]; + } else { + result += arrayNumbers[indice]; + } + } + return result; +} +console.log(Algarismos('MMXVIII')); diff --git a/fundamentos_web/bloco_4/dia_4/bonus2.js b/fundamentos_web/bloco_4/dia_4/bonus2.js new file mode 100644 index 0000000..6783b88 --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/bonus2.js @@ -0,0 +1,25 @@ +function add(num1, num2) { + const arrNum1 = num1.toString().split("").reverse(); + const arrNum2 = num2.toString().split("").reverse(); + let lessArr; + let bigArr; + const output = []; + + if (arrNum1.length > arrNum2.length) { + bigArr = arrNum1; + lessArr = arrNum2; + } else { + bigArr = arrNum2; + lessArr = arrNum1; + } + + for (let i = 0; i < bigArr.length; i += 1) { + if (lessArr[i] !== undefined) { + output[i] = parseInt(bigArr[i]) + parseInt(lessArr[i]); + } else { + output[i] = parseInt(bigArr[i]); + } + } + + return parseInt(output.reverse().join("")); + } diff --git a/fundamentos_web/bloco_4/dia_4/end_word.js b/fundamentos_web/bloco_4/dia_4/end_word.js new file mode 100644 index 0000000..a5af947 --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/end_word.js @@ -0,0 +1,13 @@ +function word(palavra, fim) { + palavra = palavra.split(""); + fim = fim.split(""); + control = true; + for (let i =0; i numeros[indice]) { + indiceMenor = indice; + } + } + return indiceMenor; + } + + console.log(indiceDoMenor([2, 4, 6, 7, 10, 0, -3])); + \ No newline at end of file diff --git a/fundamentos_web/bloco_4/dia_4/palindromo.js b/fundamentos_web/bloco_4/dia_4/palindromo.js new file mode 100644 index 0000000..d65b3a4 --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/palindromo.js @@ -0,0 +1,23 @@ +/* function palindromo(string) { + let reverse = string.split("").reverse().join(""); + if (reverse === string) { + return true; + } else { + return false; + } +} + +console.log(palindromo('kiprokó')); +console.log(palindromo('uau')); */ + +function palindrome(palavra) { + let letras = palavra.split(""); + let isPalindrome = true; + for (let index in letras) { + if (letras[index] != palavra[(palavra.length - 1) - index]) { + isPalindrome = false; + } + } + return isPalindrome; + } + console.log(palindrome('ZaaZ')); \ No newline at end of file diff --git a/fundamentos_web/bloco_4/dia_4/repetido.js b/fundamentos_web/bloco_4/dia_4/repetido.js new file mode 100644 index 0000000..56c60f5 --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/repetido.js @@ -0,0 +1,68 @@ +function maisRepetido(numbers) { + let contaRepetido = 0; + let contaNumero = 0; + let indexNumRep = 0; + for (let index in numbers) { + let verificaNumero = numbers[index]; + for (let index2 in numbers) { + if (verificaNumero === numbers[index2]) { + contaNumero += 1; + } + } + if (contaNumero > contaRepetido) { + contaRepetido = contaNumero; + indexNumRep = index; + } + contaNumero = 0; + } + return numbers[indexNumRep]; +} +console.log(maisRepetido([2, 3, 2, 5, 8, 2, 3])); + +/* Duas formas de resolver o exercício +function maisRepetido(numeros) { + let contRepetido = 0; + let contNumero = 0; + let indexNumeroRepetido = 0; + for (let index in numeros) { + let verificaNumero = numeros[index]; + for (let index2 in numeros) { + if (verificaNumero === numeros[index2]) { + contNumero++; + } + } + if (contNumero > contRepetido) { + contRepetido = contNumero; + indexNumeroRepetido = index; + } + contNumero = 0; + } + return numeros[indexNumeroRepetido]; + } + + function maisRepetido(numeros) { + let num = {}; + + for (let i = 0; i < numeros.length; i += 1) { + let valor = numeros[i]; + if (num[valor] === undefined) { + num[valor] = 1; + } else { + num[valor] = num[valor] + 1; + } + } + + let contRepetido = 0; + let contNumero = 0; + + for (let prop in num) { + if (contRepetido < num[prop]) { + contRepetido = num[prop]; + contNumero = prop; + } + } + + return contNumero; + } + + console.log(maisRepetido([2, 3, 2, 5, 8, 2, 3])); */ \ No newline at end of file diff --git a/fundamentos_web/bloco_4/dia_4/somatorio.js b/fundamentos_web/bloco_4/dia_4/somatorio.js new file mode 100644 index 0000000..b24619c --- /dev/null +++ b/fundamentos_web/bloco_4/dia_4/somatorio.js @@ -0,0 +1,8 @@ +function somatorio (numbers) { + let total = 0; + for (let i = 1; i <= numbers; i += 1) { + total = total + i; + } + return total; +} +console.log(somatorio(5)); \ No newline at end of file