Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class um {
- /**
- * @param args
- */
- public static void main(String[] args) {
- int eleitores, votosBrancos, votosNulos, votosValidos;
- String municipio;
- municipio = JOptionPane.showInputDialog("Digite o se municipio");
- eleitores = Integer.parseInt(JOptionPane.showInputDialog("Digite o numero de eleitores"));
- votosBrancos = Integer.parseInt(JOptionPane.showInputDialog("Digite o numero de votos brancos"));
- votosNulos = Integer.parseInt(JOptionPane.showInputDialog("Digite o numero de votos nulos"));
- votosValidos = Integer.parseInt(JOptionPane.showInputDialog("Digite o numero de votos validos"));
- 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+"%");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement