
-----------------------------------
slider203
Wed Mar 10, 2010 11:48 pm

Program wont run
-----------------------------------
This program reads in numbers from a file then calculate the the numbers cube (e.g. 4x4x4) The for loop should run from 1-25, since there are 25 pairs of values in the file.


import java.io.*;
class FilesPrac2
{
  public static void main (String args

inside the squares.txt file:
0 0
2 4
4 16
6 36
8 64
10 100
12 144
14 196
16 256
18 324
20 400
22 484
24 576
26 676
28 784
30 900
32 1024
34 1156
36 1296
38 1444
40 1600
42 1764
44 1936
46 2116
48 2304
50 2500

I dont know why this prgram will not run I have tried everything I can think of but it still wont work :( any help is appreciated.

-----------------------------------
Tony
Thu Mar 11, 2010 1:11 am

RE:Program wont run
-----------------------------------
If there's an exception, it's typically printed out. What does it say? (Or in what other way does the program "not run"?)

-----------------------------------
chrisbrown
Thu Mar 11, 2010 1:42 am

RE:Program wont run
-----------------------------------
for (int counter = 1 ; counter 