-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhile.html
More file actions
32 lines (27 loc) · 762 Bytes
/
Copy pathwhile.html
File metadata and controls
32 lines (27 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>While</title>
<script>
let contador = 1
const qtd = prompt('Quantas notas?')
let soma = 0
let nota = 0
while(contador <= qtd){
nota = Number(prompt('Digite a nota ' + contador))
soma = soma + nota
// contador = contador + 1
contador++
}
console.log('Soma: ' + soma)
console.log('Nota: ' + nota)
const media = soma/qtd
console.log('Média: ' + media)
const resultado = media >=7 ? 'Aprovado' : 'Reprovado'
console.log('Resultado: ' + resultado)
</script>
</head>
<body>
</body>
</html>