From 0475efe8063a61b725cc9573b6a01251abe8e134 Mon Sep 17 00:00:00 2001 From: Mara Priscilla Barros Souza Date: Wed, 18 Aug 2021 16:13:34 -0300 Subject: [PATCH] exercicio aula Loops --- semana2/loops/index.html | 13 +++++++++++++ semana2/loops/index.js | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 semana2/loops/index.html create mode 100644 semana2/loops/index.js diff --git a/semana2/loops/index.html b/semana2/loops/index.html new file mode 100644 index 0000000..cadfa45 --- /dev/null +++ b/semana2/loops/index.html @@ -0,0 +1,13 @@ + + + + + + + + LOOPS + + + + + \ No newline at end of file diff --git a/semana2/loops/index.js b/semana2/loops/index.js new file mode 100644 index 0000000..f5c2eb1 --- /dev/null +++ b/semana2/loops/index.js @@ -0,0 +1,21 @@ +// //EXERCICIO 1 = O VALOR IMPRESSO EH 10. +// //EXERCICIO 2 - A = VAI IMPRIMIR OS NUMEROS MAIORES QUE 18. +// //EXERCICIO 2 - B = NAO É SUFICIENTE, EH NECESSARIO USAR let linha = "" +// //EXERCICIO 3 - VAI IMPRIMIR 4 LINHAS, CONTENDO EM CADA UM A QUANTIDADE DE * CORRESPONDENTE + + + const bichinhos = Number(prompt("Ola, quantos bichos de estimacao vc tem?")) + let quantosBichinhos = [] + + if (bichinhos === 0) { + console.log("que pena, vc pode adotar um pet") + } + + for (i = 0; i < bichinhos; i++) { + const nomeBichinhos = prompt("Qual o nome dos bichinhos?") + quantosBichinhos.push(nomeBichinhos) + } + console.log(quantosBichinhos) + + + \ No newline at end of file