-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExer14.java
More file actions
53 lines (35 loc) · 1.13 KB
/
Exer14.java
File metadata and controls
53 lines (35 loc) · 1.13 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.laiane.cursojava.aula15;
import java.util.Scanner;
public class Exer14 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Entre com a primeira nota:");
double nota1 = scan.nextDouble();
System.out.println("Entre com a segunda nota:");
double nota2 = scan.nextDouble();
double media = (nota1 + nota2) / 2;
String aproveitamento = "";
if (media >= 9 && media <= 10){
aproveitamento = "A";
} else if (media >= 7.5 && media < 9){
aproveitamento = "B";
} else if (media >= 6 && media < 7.5){
aproveitamento = "C";
} else if (media >= 4 && media < 6){
aproveitamento = "D";
} else if (media >= 0 && media < 4){
aproveitamento = "E";
}
System.out.println("Nota 1: " + nota1);
System.out.println("Nota 2: " + nota2);
System.out.println("Média: " + media);
System.out.println("Conceito: " + aproveitamento);
switch (aproveitamento){
case "A":
case "B":
case "C": System.out.println("APROVADO"); break;
case "D":
case "E": System.out.println("REPROVADO"); break;
}
}
}