Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
16 lines (14 loc) · 423 Bytes

File metadata and controls

16 lines (14 loc) · 423 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Solicita ao usuário que insira as notas dos alunos
let notas = [];
for (let i = 1; i <= 4; i++) {
let nota = parseFloat(prompt("Digite a nota do aluno " + i + ":"));
notas.push(nota);
}
// Calcula a média das notas
let soma = 0;
for (let nota of notas) {
soma += nota;
}
let media = soma / notas.length;
// Exibe o resultado da média das notas
console.log("A média das notas é: " + media.toFixed(2));
Morty Proxy This is a proxified and sanitized view of the page, visit original site.