Main

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Main:

1 º Exemplo:

String[] musics = {"On my way", "Memories", "Perfect", "Havana"};


double[][] info = {{201.6, 3.25},
{189, 2.80},
{256.8, 2.75},
{202.8, 2.35}};

System.out.println(FindMostExpensiveMusic(musics, info));
System.out.printf("%.2fs", calculateBiggestDifference(info));
sort(musics, info);
writeToFile(musics, info, "musics.txt");
}

2º Exemplo:

String[] hours = {String.valueOf(14), String.valueOf(14), String.valueOf(14),


String.valueOf(15), String.valueOf(15), String.valueOf(15)};
int[][] airstrips = {{1,10,14},
{2,1,3},
{3,7,12},
{1,12,20},
{2,5,13},
{3,23,6}};

getAirstripBusiest(airstrips);
int[] somas = getAllAirstripFlights(airstrips);
System.out.print("[");
for (int i = 0; i<3; i++) {
if (i!=0){
System.out.print(somas[i]+"|");
}else{
System.out.print(somas[i]+"]");
System.out.println();
}
}
writeStatistics(hours, airstrips);
}

3º Exemplo:

String[] meses = {"janeiro", "fevereiro", "março", "abril", "maio", "junho"};


int[][] jogos = {{50, 30, 18, 2},
{30, 10, 20, 0},
{45, 10, 10, 25},
{35, 15, 15, 5},
{60, 22, 32, 6},
{10, 10, 0, 0}};

System.out.println("O mês mais vitorioso é o mês de " +


getTheMostVictoriousMonth(meses, jogos));
double[] medias = getAverages(jogos, meses);
System.out.print("[");
for (int i = 0; i < 4; i++) {
if (i < 3) {
System.out.printf("%.4f|", medias[i]);
} else {
System.out.printf("%.4f] \n", medias[i]);
}
}
writeStatistics(meses, jogos, medias);
}

You might also like