From cff3f6b2dd58572d8286da280996b483ac199392 Mon Sep 17 00:00:00 2001 From: Dani Botelho Date: Mon, 5 Apr 2021 15:31:47 -0300 Subject: [PATCH] =?UTF-8?q?Inclus=C3=A3o=20das=20atividades?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desafioMultas.html | 1 + desafioMultas.js | 15 +++++++++++++++ media.html | 1 + media.js | 20 ++++++++++++++++++++ teste.html | 1 + teste.js | 19 +++++++++++++++++++ teste2.html | 1 + teste2.js | 11 +++++++++++ 8 files changed, 69 insertions(+) create mode 100644 desafioMultas.html create mode 100644 desafioMultas.js create mode 100644 media.html create mode 100644 media.js create mode 100644 teste.html create mode 100644 teste.js create mode 100644 teste2.html create mode 100644 teste2.js diff --git a/desafioMultas.html b/desafioMultas.html new file mode 100644 index 0000000..20c018d --- /dev/null +++ b/desafioMultas.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desafioMultas.js b/desafioMultas.js new file mode 100644 index 0000000..10eb7c6 --- /dev/null +++ b/desafioMultas.js @@ -0,0 +1,15 @@ +var veloPermitida = Number(prompt("Informe a velocidade máxima permitida na Via: ")); +var veloCondutor = Number(prompt("Informe a velocidade do condutor: ")); + +function calcularMulta(){ + + if (veloCondutor < veloPermitida+veloPermitida*0.10 ) { + alert("Sem Multas"); + }else if (veloCondutor >= veloPermitida+veloPermitida*0.20 ) { + alert("Multa Grave"); + } else if (veloCondutor >= veloPermitida+veloPermitida*0.10) { + alert("Multa Leve"); + } + +} +calcularMulta() \ No newline at end of file diff --git a/media.html b/media.html new file mode 100644 index 0000000..a1aa79e --- /dev/null +++ b/media.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media.js b/media.js new file mode 100644 index 0000000..1211b54 --- /dev/null +++ b/media.js @@ -0,0 +1,20 @@ +/* var outNome = prompt("Digite o nome do aluno: "); + var outNota1 = Number(prompt("Digite a primeira nota: ")); + var outNota2 = Number(prompt("Digite a segunda nota: ")); */ + + function mediaAluno(nome,nota1,nota2){ + /*if (aluno == "" ||nota1 == "" || nota2 == ""){ + return mediaAluno(); + } */ + + media = (nota1+nota2)/2; + + if ( media >= 7){ + alert( nome + " aprovado, media: " + media); + } else if ( media >= 6 ){ + alert(nome +" de recuperação"); + } else { + alert(nome + " reprovado, media: " + media); + } + } + mediaAluno("Daniela",8,7); \ No newline at end of file diff --git a/teste.html b/teste.html new file mode 100644 index 0000000..bb7442f --- /dev/null +++ b/teste.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/teste.js b/teste.js new file mode 100644 index 0000000..9695e52 --- /dev/null +++ b/teste.js @@ -0,0 +1,19 @@ +var produto1 = prompt("Nome do produto 1: "); +var preco1 = Number(prompt("Valor do produto: ")); + +var produto2 = prompt("Nome do produto 2: "); +var preco2 = Number(prompt("Valor do produto: ")); + +function calcularPromo(){ +total = preco1+preco2; + + +if (produto1 == produto2 && preco1 == preco2 && total>5 ) { + alert("Valor total da compra é: " + `${total-5}`); + } else { + alert("Valor total da compra é: " + `${total}`); + } + +} + +calcularPromo(); \ No newline at end of file diff --git a/teste2.html b/teste2.html new file mode 100644 index 0000000..a74a20e --- /dev/null +++ b/teste2.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/teste2.js b/teste2.js new file mode 100644 index 0000000..8b1ec6c --- /dev/null +++ b/teste2.js @@ -0,0 +1,11 @@ +function confirmarChave(){ + var chave = Number(prompt("Insira o número correto da chave: ")); + if (chave == 1){ + alert("Chave correta"); + } else { + return confirmarChave(); + } + + } + + confirmarChave(); \ No newline at end of file