Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercício Anna Clara #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions exercicios/para-casa/anna-clara/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Exercício de lógica js</title>
<script src="main.js"></script>
</head>
<body>

</body>
</html>
12 changes: 12 additions & 0 deletions exercicios/para-casa/anna-clara/main.js
Original file line number Diff line number Diff line change
@@ -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. :(");
}