-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnove.java
More file actions
28 lines (21 loc) · 1.03 KB
/
nove.java
File metadata and controls
28 lines (21 loc) · 1.03 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
import java.util.Scanner;
public class nove {
public static void main(String[] args) {
float total_eleitores = 0, votos_brancos = 0, votos_nulos = 0, votos = 0;
Scanner scan = new Scanner(System.in);
System.out.print("Digite o total de votos brancos:");
votos_brancos = scan.nextFloat();
System.out.print("Digite o total de votos nulos:");
votos_nulos = scan.nextFloat();
System.out.print("Digite o total de votos confirmados:");
votos = scan.nextFloat();
total_eleitores = votos_nulos + votos_brancos + votos;
System.out.printf("A porcentagem de votos brancos: %.2f",(votos_brancos/total_eleitores)*100);
System.out.print("%\n");
System.out.printf("A porcentagem de votos nulos: %.2f",(votos_nulos/total_eleitores)*100);
System.out.print("%\n");
System.out.printf("A porcentagem de votos confirmados: %.2f",(votos/total_eleitores)*100);
System.out.print("%\n");
scan.close();
}
}