
-----------------------------------
chromium
Thu Apr 03, 2014 7:30 pm

Issue with storing to Array
-----------------------------------
Im trying to populate an array using a for loop. Here is my code:

[code]
import java.awt.*;
import hsa.Console;
import java.io.*;
import java.util.*;
import java.text.*;

public class P1_3_7
{
    static Console c;    
    static double[] pop97;
    static double[] pop01;

    static double[] expPopArray;

    public static void main (String[] args)
    {
        c = new Console (28, 80);

        String cities[] = {"Toronto", "Montr?al", "Ottawa-Hull", "Calgary", "Edmonton", "Calgary", "Qu?bec", "Winnipeg", "Hamilton", "London", "Kitchener",
            "St. Catharines-Niagara", "Halifax", "Victoria", "Windsor", "Oshawa", "Saskatoon", "Regina", "St. John's", "Chicoutimi-Jonqui?re",
            "Sudbury", "Sherbrooke", "Trois-Rivi?res", "Thunder Bay", "Saint John"};

        c.print ("Enter a year greater than 2000: ");
        int year = c.readInt ();
        int yearDiff = year - 1997;

        c.clear ();
        c.println ("Top ten expected populations for the year " + year + " are (in thousands): \n");

        for (int i = 0 ; i < 25 ; i++)
        {
            try
            {
                BufferedReader br = new BufferedReader (new FileReader (new File ("popCities97to01.txt")));
                pop97 = new double [25];
                pop01 = new double [25];

                String line = "";
                for (int j = 0 ; j 