title: Stuck on a Java problem - how do I create an array out of a list and summarize it?
body: <p>I need to program for school but I'm stuck right now.</p>
  <p><strong>Introduction</strong></p>
  <p>I have a file named  &quot;carlist.txt.&quot; This file has on each line information about a car in this order:
  vehicle_idnumber  num_of_passengers  fuel_capacity   mpg   make</p>
  <p>So, a typical line might look like this: 487833  6 20 25  Ford</p>
  <p>When you read in the file, you are guaranteed it is “clean”. The data are always:int int int int String over and over. This makes your work a lot simpler.</p>
  <p>You also need to add a “method” to your vehicle object definition. This method should be a function that returns a double. The function computes the range of the vehicle. All it does is take the fuelcap and multiply it by the mpg. Your “turn-in” program needs to solve the following tasks.</p>
  <p>Program 1:</p>
  <p>Write a method which walks the array of cars and prints out the total number of each make of car. Your output should look something like: (these are made up numbers!)</p>
  <p>MAKE  NUMOFCARS</p>
  <p>Ford 17
  Subaru 23
  GM   8
  Porsche 5
  Toyota  35
  Suburban  12</p>
  <p>Program 2:
  Write a method which analyzes all the cars and prints out the car id that has the highest range and the car id that has the lowest range. Note: range means fuel_cap * mpg. So, for example you might print out: (note, these are made-up numbers!)</p>
  <p>Highest range: 987654  with a range of 430 miles
  Lowest range: 234567 with a range of 223 miles</p>
  <p>In the example above the big number is the car vehicle number and the “miles” number is the range.</p>
  <hr />
  <p>For program 1, I have to create an array (not array list!) but I don't how to deal with the fact that I don't know the size of the array upfront (since I don't know how many carmodels the list contains). How can I add car models or how do I handle the fact that one list might contain 5 car models and the next list contains 15 different models. How do I create this array out of my list?</p>