Guest User

Untitled

a guest
Jan 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. carrier UA = new carrier("Us Airways", 100, 50);
  2. carrier Delta = new carrier("Delta", 100, 50);
  3.  
  4. public static void main (String [] args) throws Exception{
  5.  
  6. CSVReader reader = new CSVReader(new FileReader("delayed.csv"));
  7. String [] nextLine;
  8.  
  9. String[][] flightData = new String[221][3];
  10. int i=0;
  11. while ((nextLine = reader.readNext()) != null) {
  12.  
  13. for(int r = 0; r<2; r++){
  14. flightData[i][0] = nextLine[1];
  15. flightData[i][1] = nextLine[6];
  16. flightData[i][2] = nextLine[7];
  17. }
  18. i++;
  19. //System.out.println("Carrier: " + nextLine[1] + "ttTotal: " + nextLine[6] + "ttDelayed: " + nextLine[7] + "");
  20. }
  21. while(flightData != null){
  22. carrier
  23. }
  24. }
  25.  
  26. List<Carrier> listCarrier = new ArrayList<Carrier>();
  27.  
  28. while ((nextLine = reader.readNext()) != null) {
  29.  
  30. listCarrier.add(new Carrier(nextLine[1], Integer.valueOf(nextLine[6]), Integer.valueOf(nextLine[7])));
  31.  
  32. }
  33.  
  34. Map<String, Carrier> listCarrier = new HashMap<String, Carrier>();
  35.  
  36. Carrier carrier = new Carrier(nextLine[1], Integer.valueOf(nextLine[6]), Integer.valueOf(nextLine[7]));
  37. listCarrier .put(nextLine[1],carrier );
  38. //Here the key is the carrier name, and the value is the carrier object
  39.  
  40. listCarrier.get("carrier_name")
  41.  
  42. carrier* carrierList = new carrier[10];
  43. for (int i = 0; i < 10; i++)
  44. carrierList[i] = new carrier(arguments);
Add Comment
Please, Sign In to add comment