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

desafio 1 JS #13

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
5 changes: 5 additions & 0 deletions desafiodecasa.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html lang="pt-br">
<meta charset="utf-8" />
<script type="text/javascript" src="desafiodecasa.js">
</script>
</html>
14 changes: 14 additions & 0 deletions desafiodecasa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function calcularVelocidadePermitida(){
var velocidadePermitida = parseInt(prompt("Qual é a velocidade da via?"));
var velocidadeCondutor = parseInt(prompt("Qual a sua velocidade?"));

if (velocidadeCondutor <= velocidadePermitida) {
alert("Sem multa!")
} else if (velocidadeCondutor <= (velocidadePermitida * 1.1)) {
alert("Multa leve!")
} else if (velocidadeCondutor > velocidadePermitida * 1.2) {
alert("Multa grave!")
}

}
calcularVelocidadePermitida()