Advertisement
angaro192

um.java

Apr 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. import javax.swing.JOptionPane;
  2. public class um {
  3.  
  4.     /**
  5.      * @param args
  6.      */
  7.     public static void main(String[] args) {
  8.         int eleitores, votosBrancos, votosNulos, votosValidos;
  9.         String municipio;
  10.         municipio = JOptionPane.showInputDialog("Digite o se municipio");
  11.         eleitores = Integer.parseInt(JOptionPane.showInputDialog("Digite o numero de eleitores"));
  12.         votosBrancos = Integer.parseInt(JOptionPane.showInputDialog("Digite o numero de votos brancos"));
  13.         votosNulos = Integer.parseInt(JOptionPane.showInputDialog("Digite o numero de votos nulos"));
  14.         votosValidos = Integer.parseInt(JOptionPane.showInputDialog("Digite o numero de votos validos"));
  15.         JOptionPane.showMessageDialog(null, "No municipio de "+ municipio+" a porcentagem de votos é: \nVotos brancos: " + votosBrancos*100/eleitores + "% \nVotos nulos: " + votosNulos*100/eleitores + "% \nVotos validos: " + votosValidos*100/eleitores+"%");
  16.     }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement