Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. public static void showInfoAlpha(String votes[], String deputados[][], int nDep, Scanner in){
  2. int contPag = 0;
  3. String aux;
  4. String aux2;
  5. String aux3;
  6. String aux4;
  7. String[]shortnames = new String [nDep];
  8. for (int i = 0; i < nDep; i++){
  9. if (i % Main.MAX_LINHAS_PAGINA == 0){
  10. if (contPag > 0){
  11. pause(in);
  12. }
  13. contPag++;
  14. System.out.println("\nPÁGINA: " + contPag);
  15. }
  16. shortnames[i] = Utilitarios.encontrarNomeApelido(deputados[i][1]);
  17. if (deputados[i][0].compareTo(deputados[i+1][0]) > 0){
  18. aux = deputados[i+1][0];
  19. deputados[i+1][0] = deputados[i][0];
  20. deputados[i][0] = aux;
  21. aux2 = deputados[i+1][2];
  22. deputados[i+1][2] = deputados[i][2];
  23. deputados[i][2] = aux2;
  24. aux3 = shortnames[i+1];
  25. shortnames[i+1] = shortnames[i];
  26. shortnames[i] = aux3;
  27. aux4 = votes[i+1];
  28. votes[i+1] = votes[i];
  29. votes[i] = aux4;
  30. }
  31. System.out.printf("%-10s%-20s%-10s%-3s", deputados[i][0], shortnames[i], deputados[i][2], votes[i]);
  32. }
  33. }
  34.  
  35. public static void header2(){
  36. System.out.printf("%-10s%-20s%-10s%-3s", "ID", "NOME", "PARTIDO", "VOTAÇÂO");
  37. System.out.println("------------------------------------------------------------------");
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement