/* More practice with methods and intro to arrays */ package seventhfall16; /** * * @author jcmtiernan */ public class SeventhFall16 { /** * @param args the command line arguments */ public static void main(String[] args) { int team1 = 127; int team2 = 3697; int team3 = 4745; int team4 = 7172; int team5 = 6169; int team6 = 10044; int team7 = 10443; int team8 = 201601234; int[] teams = new int[10]; teams[0] = 4001; teams[1] = 9687; teams[2] = 3214; teams[3] = 987; teams[4] = 1276; teams[5] = 6748; teams[6] = 3715; teams[9] = 887; String team1Name = "Fighting Pickles"; String team2Name = "Devastatorz"; String team3Name = "Thorn's Army"; String team4Name = "Techinical Difficulties"; String team5Name = "Men in Black"; String team7Name = "Tech Vikes"; String team6Name = "Mecha Men"; team8 = 12000; String[] teamNames =new String[10]; teamNames[0] = "Robotic Cows of Death"; teamNames[1] = "Corncobs"; teamNames[2] = "Ratchet and Clank"; teamNames[3] = "Big Hero 987"; teamNames[4] = "People"; teamNames[5] = "Pandemonium"; teamNames[6] = "Orozco's Army"; teamNames[9] = "TS"; int[] scores = new int[10]; int rankings[] = {1,2,3,4,5,6,7,8}; System.out.println("The length of scores array is "+scores.length + " and rankings array is "+rankings.length); for (int index = 0; index < 8 ; index++) { System.out.println("scores["+index+"] is "+scores[index]); System.out.println("rankings["+index+"] is "+rankings[index]); } // Print matching team numbers and names /*if ((team1 > 0) && (team1 < 20000)) { System.out.println("Team number is "+team1 +" and team name is "+team1Name); }*/ /*if ((team2 > 0) && (team2 < 20000)) { System.out.println("Team number is "+team2 +" and team name is "+team2Name); } if ((team3 > 0) && (team3 < 20000)) { System.out.println("Team number is "+team3 +" and team name is "+team3Name); }*/ /* printTeamBanner(team1, team1Name); printTeamBanner(team2, team2Name); printTeamBanner(team3, team3Name); printTeamBanner(team4, team4Name); //printTeamBanner(3, ""); System.out.println("****"); for (int index = 0; index < teams.length ; index++) { printTeamBanner(teams[index],teamNames[index]); } */ } public static void printTeamBanner(int teamNum, String teamName) { if ((teamNum > 0) && (teamNum < 20000)) { System.out.println("Team number is "+teamNum +" and team name is "+teamName); } } }