From 872a2c46acd0f1dd197f81085192a229fbf219a0 Mon Sep 17 00:00:00 2001 From: andradeannac Date: Tue, 25 Apr 2023 21:45:59 -0300 Subject: [PATCH] =?UTF-8?q?Exerc=C3=ADcio=20Anna=20Clara?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exercicios/para-casa/anna-clara/index.html | 13 +++++++++++++ exercicios/para-casa/anna-clara/main.js | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 exercicios/para-casa/anna-clara/index.html create mode 100644 exercicios/para-casa/anna-clara/main.js diff --git a/exercicios/para-casa/anna-clara/index.html b/exercicios/para-casa/anna-clara/index.html new file mode 100644 index 0000000..11b002e --- /dev/null +++ b/exercicios/para-casa/anna-clara/index.html @@ -0,0 +1,13 @@ + + + + + + + Exercício de lógica js + + + + + + \ No newline at end of file diff --git a/exercicios/para-casa/anna-clara/main.js b/exercicios/para-casa/anna-clara/main.js new file mode 100644 index 0000000..30eb7cc --- /dev/null +++ b/exercicios/para-casa/anna-clara/main.js @@ -0,0 +1,12 @@ +let studantName = prompt('Qual o nome do estudante?') +let gradeOne = prompt('Qual a nota do primeiro semestre?') +let gradeTwo = prompt('Qual a nota do segundo semestre?') +let media = (parseFloat(gradeOne) + parseFloat(gradeTwo))/2 + +if (media >= 7) { + alert("Parabéns, " + studantName + ". Você foi aprovado! :D"); +} else if (media >= 5) { + alert(studantName + ", você pode fazer a recuperação."); +} else { + alert(studantName + ", infelizmente você foi reprovado. :("); +} \ No newline at end of file