forked from elasComputacao/BabySteps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1040.java
44 lines (32 loc) · 915 Bytes
/
1040.java
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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
float a = input.nextFloat();
float b = input.nextFloat();
float c = input.nextFloat();
float d = input.nextFloat();
float media = (a * 2 + b * 3 + c * 4 + d * 1) / 10;
System.out.printf("Media: %.1f%n", media);
if(media >= 7.0) {
System.out.println("Aluno aprovado.");
}
else if(media < 5.0) {
System.out.println("Aluno reprovado.");
}
else {
System.out.println("Aluno em exame.");
float notaExame = input.nextFloat();
System.out.printf("Nota do exame: %.1f%n", notaExame);
media = (media + notaExame) / 2;
if(media >= 5.0) {
System.out.println("Aluno aprovado.");
}
else {
System.out.println("Aluno reprovado.");
}
System.out.printf("Media final: %.1f%n", media);
}
input.close();
}
}