From fc112b0018e7286cf5e9d57fe94010d4d025870c Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Mon, 13 Sep 2021 11:56:30 -0300 Subject: [PATCH 01/13] Update q2.html --- "quest\303\243o02/q2.html" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/quest\303\243o02/q2.html" "b/quest\303\243o02/q2.html" index 2c696c1..c249a57 100644 --- "a/quest\303\243o02/q2.html" +++ "b/quest\303\243o02/q2.html" @@ -5,7 +5,7 @@ - Document + Somando numeros From 96aa85cf081bd268997a54579658921f17590ac9 Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 14 Sep 2021 19:25:56 -0300 Subject: [PATCH 02/13] update q2 --- "quest\303\243o02/q2.html" | 13 +++++++++++++ "quest\303\243o02/style.css" | 1 + 2 files changed, 14 insertions(+) create mode 100644 "quest\303\243o02/style.css" diff --git "a/quest\303\243o02/q2.html" "b/quest\303\243o02/q2.html" index c249a57..db4aff5 100644 --- "a/quest\303\243o02/q2.html" +++ "b/quest\303\243o02/q2.html" @@ -5,9 +5,22 @@ + Somando numeros +
Somando os Números
+
+
+

Digite um número:

+

+

+
+
+
+
+

© Anaverso

+
\ No newline at end of file diff --git "a/quest\303\243o02/style.css" "b/quest\303\243o02/style.css" new file mode 100644 index 0000000..d93bdff --- /dev/null +++ "b/quest\303\243o02/style.css" @@ -0,0 +1 @@ + width: 150px; From 1b77a643861adf00955d71c5794ca307a7785641 Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 14 Sep 2021 19:25:59 -0300 Subject: [PATCH 03/13] Update style.css --- "quest\303\243o02/style.css" | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git "a/quest\303\243o02/style.css" "b/quest\303\243o02/style.css" index d93bdff..c8d8a7b 100644 --- "a/quest\303\243o02/style.css" +++ "b/quest\303\243o02/style.css" @@ -1 +1,29 @@ +body{ + background-color: rgb(123, 123, 199); + font: normal 14pt Arial; + font-weight: bolder; +} +header{ + color: white; + text-align: center; +} +section{ + background-color: white; + border-radius: 10px; + padding: 15px; + width: 500px; + margin: auto; + box-shadow: rgb(80, 78, 78) 5px 5px 10px ; + color: rgb(123, 123, 199); + +} +select#add{ width: 150px; + + +} +footer{ + color: white; + text-align: center; + font-style: italic; +} \ No newline at end of file From f1889c68879944e4fbce5a673f2f886a19d9d5f5 Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 14 Sep 2021 19:26:04 -0300 Subject: [PATCH 04/13] Update q2.js --- "quest\303\243o02/q2.js" | 52 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git "a/quest\303\243o02/q2.js" "b/quest\303\243o02/q2.js" index 259cdb2..8cadd4d 100644 --- "a/quest\303\243o02/q2.js" +++ "b/quest\303\243o02/q2.js" @@ -5,26 +5,68 @@ var c = 0 var par = 0 var imp = 0 var pri = 0 -for(c = 1; c <= 10; c++){ - var num = parseInt(prompt("Digite um número:")) +var num = document.querySelector('input#num') +var lista = document.querySelector('select#add') +var res = document.querySelector('div#res') +var numeros = [] +function inlista(num, l){ + if(l.indexOf(Number(num))){ + return true + }else{ + return false + } +} + +function Adicionar(){ + if (inlista(num.value, numeros)){ + numeros.push(Number(num.value)) + var item = document.createElement('option') + item.text = `Valor ${num.value} adicionado.` + lista.appendChild(item) + res.innerHTML = '' + } + num.value = '' + num.focus() +} + +function ePar(num){ if (num%2 ==0){ par+= num }else{ imp+= num } +} + +function ePrimo(num){ var divisor = 0 for (i = num; i > 0; i--){ - //console.log(`[${num}] está sendo dividido por ${i}`) if (num%i == 0){ divisor ++ } } if(divisor == 2){ pri += num - //console.log(`[${pri}]`) } + } console.log(`A soma dos números primos dá: ${pri}`) console.log(`A soma dos numeros pares dá: ${par}`) -console.log(`A soma dos numeros impares dá: ${imp}`) \ No newline at end of file +console.log(`A soma dos numeros impares dá: ${imp}`) +function Somar(){ + res.innerHTML += `

A soma dos números primos dá:

` + res.innerHTML += `

A soma dos números pares dá:

` + res.innerHTML += `

A soma dos números impares dá:

` + +} + +//for(c = 1; c <= 10; c++){ + //var num = parseInt(prompt("Digite um número:")) + + + + //console.log(`[${num}] está sendo dividido por ${i}`) + + + //console.log(`[${pri}]`) + From 28209864e32648c5bf89bf8e1fdf34286b4ca26e Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Wed, 15 Sep 2021 14:04:21 -0300 Subject: [PATCH 05/13] Update q2.js --- "quest\303\243o02/q2.js" | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git "a/quest\303\243o02/q2.js" "b/quest\303\243o02/q2.js" index 8cadd4d..6d04a78 100644 --- "a/quest\303\243o02/q2.js" +++ "b/quest\303\243o02/q2.js" @@ -50,13 +50,11 @@ function ePrimo(num){ } } -console.log(`A soma dos números primos dá: ${pri}`) -console.log(`A soma dos numeros pares dá: ${par}`) -console.log(`A soma dos numeros impares dá: ${imp}`) + function Somar(){ - res.innerHTML += `

A soma dos números primos dá:

` - res.innerHTML += `

A soma dos números pares dá:

` - res.innerHTML += `

A soma dos números impares dá:

` + res.innerHTML += `

A soma dos números primos dá:

` + res.innerHTML += `

A soma dos números pares dá:

` + res.innerHTML += `

A soma dos números impares dá:

` } From e50d546a5e8d73cc1ce070bb2bd7011fccdf813e Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 28 Sep 2021 14:36:07 -0300 Subject: [PATCH 06/13] Update q2.js --- "quest\303\243o02/q2.js" | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git "a/quest\303\243o02/q2.js" "b/quest\303\243o02/q2.js" index 6d04a78..491b886 100644 --- "a/quest\303\243o02/q2.js" +++ "b/quest\303\243o02/q2.js" @@ -5,6 +5,7 @@ var c = 0 var par = 0 var imp = 0 var pri = 0 +var soma = 0 var num = document.querySelector('input#num') var lista = document.querySelector('select#add') var res = document.querySelector('div#res') @@ -20,6 +21,7 @@ function inlista(num, l){ function Adicionar(){ if (inlista(num.value, numeros)){ + console.log(num) numeros.push(Number(num.value)) var item = document.createElement('option') item.text = `Valor ${num.value} adicionado.` @@ -30,15 +32,20 @@ function Adicionar(){ num.focus() } -function ePar(num){ +for (var i = 0;i 0; i--){ if (num%i == 0){ @@ -48,8 +55,9 @@ function ePrimo(num){ if(divisor == 2){ pri += num } - } + + function Somar(){ res.innerHTML += `

A soma dos números primos dá:

` From 0fcff16b3510718c26b7cdf5126a54395ecc2af8 Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 28 Sep 2021 14:36:13 -0300 Subject: [PATCH 07/13] Update q1.js --- "quest\303\243o01/q1.js" | 165 +++++++++++++++++++++++++-------------- 1 file changed, 108 insertions(+), 57 deletions(-) diff --git "a/quest\303\243o01/q1.js" "b/quest\303\243o01/q1.js" index 4582e99..56195b7 100644 --- "a/quest\303\243o01/q1.js" +++ "b/quest\303\243o01/q1.js" @@ -1,72 +1,123 @@ -/*Defina um conjunto de dados contendo a altura, peso e o sexo (M ou F) de 15 pessoas, em -seguida calcule e informe: -a. A média de altura do grupo; (check) -b. A mulher mais alta e o homem mais baixo; (check) -c. O número de homens com mais de 1,70 m de altura;(check) -d. O homem mais pesado;(check) -e. O percentual de homens e de mulheres.(check) -*/ -function getRandomArbitrary(min, max) { - return (Math.random() * (max - min) + min).toFixed(2); - } - -function sexoAleatorio(){ - const sexo = ['M','F'] - sorteio = Math.floor(Math.random() * sexo.length) - return sexo[sorteio] -} - +var contador = 1 +var resposta = document.getElementById("respostas") class Pessoa{ constructor(altura, peso, sexo){ this.altura = parseFloat(altura) - this.peso = peso + this.peso = parseFloat(peso) this.sexo = sexo } } +function calcular(){ -let media_altura = 0 -let mulher_mais_alta = 0 -let homem_mais_baixo = 3 -let homens_de_170 = 1.70 -let homem_mais_pesado = 0 -let total = 0 -let quant_fem = 0 -let quant_masc = 0 -let cont_homens=0 -for(i = 0; i < 15; i++){ - var pessoa = new Pessoa(getRandomArbitrary(1.5,2), getRandomArbitrary(40, 100), sexoAleatorio()) - console.log(i, pessoa.altura, pessoa.peso, pessoa.sexo) - media_altura += pessoa.altura - if(pessoa.sexo === 'F'){ - quant_fem++ - } - if(pessoa.sexo === 'M'){ - quant_masc++ - } - if (pessoa.sexo === 'M' && pessoa.altura > homens_de_170){ - homens_de_170 = pessoa.altura - //console.log(homens_de_170) - cont_homens++ - + let linhas = document.getElementById('minha-tabela').getElementsByTagName('tr') + let pessoas = [] + let media_altura = 0 + let mulher_mais_alta = 0 + let homem_mais_baixo = 3 + let total_homens = 0 + let total_mulheres = 0 + + if(linhas.length > 1){ + for (let index = 1; index < linhas.length; index++) { + const dados = linhas[index].innerText.split("\t") + pessoas.push(new Pessoa(dados[1],dados[2],dados[3])) + + + } + for (const pessoa of pessoas) { + console.log(pessoa.altura,pessoa.peso,pessoa.sexo) + media_altura += pessoa.altura + if (pessoa.sexo === 'F' && pessoa.altura > mulher_mais_alta){ + mulher_mais_alta = pessoa.altura + } + if(pessoa.sexo === 'M' && pessoa.altura < homem_mais_baixo){ + homem_mais_baixo = pessoa.altura + } + if(pessoa.sexo === 'M'){ + total_homens ++ + } + else{ + total_mulheres++ + } + } + console.log(`A média de altura é: ${(media_altura/pessoas.length).toFixed(2)}`) + console.log(`A mulher mais alta é ${mulher_mais_alta}`) + console.log(`O homem mais baixo é ${homem_mais_baixo}`) + console.log(`O total de homens é ${total_homens} e o percentual ${((total_homens*100)/pessoas.length).toFixed(2)}%`) + console.log(`O total de mulheres é ${total_mulheres} e o percentual ${((total_mulheres*100)/pessoas.length).toFixed(2)}%`) + resposta.innerHTML = "A média de altura é: "+(media_altura/pessoas.length).toFixed(2) + "
" + resposta.innerHTML += `A mulher mais alta é ${mulher_mais_alta}
` + if (homem_mais_baixo === 3){ + homem_mais_baixo = 0 + } + else{ + resposta.innerHTML += `O homem mais baixo é ${homem_mais_baixo}
` + } + resposta.innerHTML += `O total de homens é ${total_homens} e o percentual ${((total_homens*100)/pessoas.length).toFixed(2)}%
` + resposta.innerHTML += `O total de mulheres é ${total_mulheres} e o percentual ${((total_mulheres*100)/pessoas.length).toFixed(2)}%` } - if (pessoa.sexo === 'F' && pessoa.altura > mulher_mais_alta){ - mulher_mais_alta = pessoa.altura + else{ + alert("Tabela vazia") } - if(pessoa.sexo === 'M' && pessoa.altura < homem_mais_baixo){ - homem_mais_baixo = pessoa.altura +} +function gerarAleatorio(){ + resposta.innerHTML = "" + limparTabela() + if (contador > 0){ + contador = 1 } + let tabela = document.querySelector("#dados-tabela") + for (i = 0; i <15; i++){ + let linha = tabela.insertRow() + linha.insertCell(0).innerText = `${contador++}` + linha.insertCell(1).innerText = `${getRandomArbitrary(1.5,2)}` + linha.insertCell(2).innerText = `${getRandomArbitrary(40, 100)}` + linha.insertCell(3).innerText = `${sexoAleatorio()}` + } - if (pessoa.sexo === 'M' && pessoa.peso > homem_mais_pesado){ - homem_mais_pesado = pessoa.peso - } +} + +function getRandomArbitrary(min, max) { + return (Math.random() * (max - min) + min).toFixed(2); + } +function sexoAleatorio(){ + const sexo = ['M','F'] + sorteio = Math.floor(Math.random() * sexo.length) //aleatoriedade + return sexo[sorteio] } -console.log(`A média da aultura é: ${(media_altura/15).toFixed(2)}`) -console.log(`A mulher mais alta é ${mulher_mais_alta}`) -console.log(`O homem mais baixo é ${homem_mais_baixo}`) -console.log(`Existe ${cont_homens.toFixed()} homens com mais de 1,70 de altura`) -console.log(`O homem mais pesado tem ${homem_mais_pesado} Kg`) -console.log(`A porcentagem de mulheres é ${((quant_fem/15)*100).toFixed()}%`) -console.log(`A porcentagem de homens é ${((quant_masc/15)*100).toFixed()}%`) \ No newline at end of file +function limparTabela(){ + let tabela = document.querySelector("#dados-tabela") + while (tabela.hasChildNodes()) { + tabela.removeChild(tabela.lastChild); //exclui as linhas antigas mantendo sempre 15 + } + contador = 1 +} + +function checkDados(){ + resposta.innerHTML = "" + if (contador < 16){ + let modal = document.querySelector("#exampleModal") + let alt = document.querySelector("#altura").value + let peso = document.querySelector("#peso").value + let sexo = document.querySelector("#datalistOptions").getElementsByTagName("option")[1].value + + if ( alt !=="" && peso !=="" && sexo !==""){ + let tabela = document.querySelector("#dados-tabela") + let linha = tabela.insertRow() + linha.insertCell(0).innerText = `${contador++}` + linha.insertCell(1).innerText = `${alt}` + linha.insertCell(2).innerText = `${peso}` + linha.insertCell(3).innerText = `${sexo}` + } + }else{ + if(confirm("Lista cheia")){ + limparTabela() + checkDados() + } + } +} + + From aa48651aab45c91f6177e2ad55e6640d3184072b Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 28 Sep 2021 14:36:16 -0300 Subject: [PATCH 08/13] Update q1.html --- "quest\303\243o01/q1.html" | 87 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 4 deletions(-) diff --git "a/quest\303\243o01/q1.html" "b/quest\303\243o01/q1.html" index b356ac4..0b307bf 100644 --- "a/quest\303\243o01/q1.html" +++ "b/quest\303\243o01/q1.html" @@ -1,11 +1,90 @@ - + + - Document + + + Exercício 01 - - + + +

+
+
+ + + + +
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + +
IdAlturaPesoSexo
+
+
+
+ + + + \ No newline at end of file From adf99356459f09a097d18b947ab1996ab755186b Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 28 Sep 2021 14:36:53 -0300 Subject: [PATCH 09/13] Update q1.html --- "quest\303\243o01/q1.html" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/quest\303\243o01/q1.html" "b/quest\303\243o01/q1.html" index 0b307bf..795aaf3 100644 --- "a/quest\303\243o01/q1.html" +++ "b/quest\303\243o01/q1.html" @@ -4,7 +4,7 @@ - + Exercício 01 From 281abda7d0af66ace8713bddfebe2a937aede00c Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 28 Sep 2021 14:49:23 -0300 Subject: [PATCH 10/13] Update q1.html --- "quest\303\243o01/q1.html" | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git "a/quest\303\243o01/q1.html" "b/quest\303\243o01/q1.html" index 795aaf3..cd5ec58 100644 --- "a/quest\303\243o01/q1.html" +++ "b/quest\303\243o01/q1.html" @@ -4,17 +4,15 @@ - + Exercício 01 -
+
-
- - +
From be7ee728fafca14550bee4da4a2a3beca04d03a5 Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 28 Sep 2021 14:49:26 -0300 Subject: [PATCH 11/13] Create style.css --- "quest\303\243o01/style.css" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "quest\303\243o01/style.css" diff --git "a/quest\303\243o01/style.css" "b/quest\303\243o01/style.css" new file mode 100644 index 0000000..e69de29 From 51a5510014ccd4f528ea56e1e5d1faf9adf5c1ac Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 28 Sep 2021 14:49:29 -0300 Subject: [PATCH 12/13] Update q3.html --- "quest\303\243o03/q3.html" | 75 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git "a/quest\303\243o03/q3.html" "b/quest\303\243o03/q3.html" index 2dfb1f8..524b588 100644 --- "a/quest\303\243o03/q3.html" +++ "b/quest\303\243o03/q3.html" @@ -1,12 +1,79 @@ - + - Document + + Exercício 03 - - + + +
+
+
+ + +
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + +
IdIdadeNota
+
+
+
+ +
+
+
+
+
Cadastro
+ + +
+
+ +
+ + +
Insira uma idade
+ + + +
Insira uma nota
+ + +
+
+
+ +
+
+
+
+ + \ No newline at end of file From de98e3dd01ebd78d8a3dc8fbed242cc37d58a32c Mon Sep 17 00:00:00 2001 From: Ana Laura da Silva Pereira Date: Tue, 28 Sep 2021 14:49:31 -0300 Subject: [PATCH 13/13] Update q3.js --- "quest\303\243o03/q3.js" | 148 ++++++++++++++++++++++++++++----------- 1 file changed, 106 insertions(+), 42 deletions(-) diff --git "a/quest\303\243o03/q3.js" "b/quest\303\243o03/q3.js" index 04814a0..1d9e9b3 100644 --- "a/quest\303\243o03/q3.js" +++ "b/quest\303\243o03/q3.js" @@ -1,49 +1,113 @@ -/*Faça um programa que receba a idade e a opinião de 15 espectadores de um cinema em relação -a um determinado filme, sendo ótimo - 3, bom - 2, regular -1, em seguida calcule e informe: -a. A média das idades das pessoas que responderam ótimo;(check) -b. A quantidade de pessoas que responderam regular;(check) -c. A porcentagem de pessoas que responderam bom entre todos os espectadores -analisados.(check) -*/ - -var c = 0 -var otimo = 0 -var regular = 0 -var bom = 0 -var idadeotimo = 0 -var opnregular = 0 -var opnbom = 0 -var media = 0 -for (c = 1;c <= 15;c++){ - idade = parseInt(prompt("["+c+"] Digite sua idade:")) - opn = prompt("Digite aqui sua opnião sobre o filme: regular - 1, bom - 2, ótimo - 3: ") - - while (opn < 1 || opn > 3){ - alert("Digite uma opção valida") - opn = prompt("Digite aqui sua opnião sobre o filme: regular - 1, bom - 2, ótimo - 3: ") - } - if (idade == 0){ - alert("Digite uma opção valida") - } - else{ - if (opn == 3){ - otimo += idade - idadeotimo++ +var contador = 1 +var resposta = document.getElementById("respostas") +class Pessoa{ + constructor(idade, nota){ + this.idade = parseFloat(idade) + this.nota = nota + } +} + + +function calcular(){ + + let linhas = document.getElementById('minha-tabela').getElementsByTagName('tr') + let pessoas = [] + let media_idade_otimo = 0 + let total_regular = 0 + let idade_otimo = 0 + let total_otimo = 0 + let total_bom = 0 + + if(linhas.length > 1){ + for (let index = 1; index < linhas.length; index++) { + + const dados = linhas[index].innerText.split("\t") + pessoas.push(new Pessoa(dados[1],dados[2])) + } - if (opn == 1){ - regular += opn - opnregular++ + for (const pessoa of pessoas) { + console.log(pessoa.idade,pessoa.nota) + if (pessoa.nota === '3'){ + media_idade_otimo += pessoa.idade + total_otimo++ + } + if(pessoa.nota === '1'){ + total_regular++ + } + if(pessoa.nota === '2'){ + total_bom++ + + } } - if (opn == 2){ - bom += opn - opnbom++ + + console.log("A média das idades das pessoas que responderam 'ótimo' é de: " + Math.round(media_idade_otimo/total_otimo)) + console.log("A quantidade de pessoas que responderam 'regular': " + total_regular) + console.log(`O total de pessoas que responderam 'bom' foi ${total_bom} e o percentual ${((total_bom*100)/pessoas.length).toFixed(2)}%`) + + resposta.innerHTML += "A média das idades das pessoas que responderam 'ótimo' é de: " + Math.round(media_idade_otimo/total_otimo).toFixed(2) + "
" + resposta.innerHTML += `A quantidade de pessoas que responderam 'regular': ${total_regular}
` + resposta.innerHTML += `O total de pessoas que responderam 'bom' foi ${total_bom} e o percentual ${((total_bom*100)/pessoas.length).toFixed(2)}%
` } + else{ + alert("Tabela vazia") } +} + +function checkDados(){ + resposta.innerHTML = "" + if (contador < 16){ + let modal = document.querySelector("#exampleModal") + let idade = document.querySelector("#idade").value + let nota = document.querySelector("#nota").value + + if ( idade!=="" && nota !==""){ + let tabela = document.querySelector("#dados-tabela") + let linha = tabela.insertRow() + linha.insertCell(0).innerText = `${contador++}` + linha.insertCell(1).innerText = `${idade}` + linha.insertCell(2).innerText = `${nota}` + + } + }else{ + if(confirm("Lista cheia")){ + limparTabela() + checkDados() + } + } } -media = otimo/idadeotimo -bomporcen = (opnbom*100)/15 -console.log(`A quantidade de pessoas que responderam regular foi: ${opnregular}`) -console.log(`A media de idade das pessoas que respoderam otimo foi ${media}`) -console.log(`A porcentagem das pessoas que responderam bom foi ${bomporcen}%`) \ No newline at end of file +function gerarAleatorio(){ + resposta.innerHTML = "" + limparTabela() + if (contador > 0){ + contador = 1 + } + let tabela = document.querySelector("#dados-tabela") + for (i = 0; i <15; i++){ + let linha = tabela.insertRow() + linha.insertCell(0).innerText = `${contador++}` + linha.insertCell(1).innerText = `${getRandomInt(16,60)}` + linha.insertCell(2).innerText = `${notaAleatorio()}` + } + +} + +function getRandomInt(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min)) + min; +} +function notaAleatorio(){ + const nota = ['1','2','3'] + let sorteio = Math.floor(Math.random() * nota.length) + return nota[sorteio] +} + +function limparTabela(){ + let tabela = document.querySelector("#dados-tabela") + while (tabela.hasChildNodes()) { + tabela.removeChild(tabela.lastChild); //exclui as linhas antigas mantendo sempre 15 + } + contador = 1 +}