Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void showInfoAlpha(String votes[], String deputados[][], int nDep, Scanner in){
- int contPag = 0;
- String aux;
- String aux2;
- String aux3;
- String aux4;
- String[]shortnames = new String [nDep];
- for (int i = 0; i < nDep; i++){
- if (i % Main.MAX_LINHAS_PAGINA == 0){
- if (contPag > 0){
- pause(in);
- }
- contPag++;
- System.out.println("\nPÁGINA: " + contPag);
- }
- shortnames[i] = Utilitarios.encontrarNomeApelido(deputados[i][1]);
- if (deputados[i][0].compareTo(deputados[i+1][0]) > 0){
- aux = deputados[i+1][0];
- deputados[i+1][0] = deputados[i][0];
- deputados[i][0] = aux;
- aux2 = deputados[i+1][2];
- deputados[i+1][2] = deputados[i][2];
- deputados[i][2] = aux2;
- aux3 = shortnames[i+1];
- shortnames[i+1] = shortnames[i];
- shortnames[i] = aux3;
- aux4 = votes[i+1];
- votes[i+1] = votes[i];
- votes[i] = aux4;
- }
- System.out.printf("%-10s%-20s%-10s%-3s", deputados[i][0], shortnames[i], deputados[i][2], votes[i]);
- }
- }
- public static void header2(){
- System.out.printf("%-10s%-20s%-10s%-3s", "ID", "NOME", "PARTIDO", "VOTAÇÂO");
- System.out.println("------------------------------------------------------------------");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement