need help

I have homework to correct this program. Can y say whats wrong with it?
And how to correct. Pleeeeaze

import java.io.*;

class processorX {
// Main
public static void main (String args[]) {
int nums[] = new int[30];

System.out.println("Starting processing...");

try {
// New file data input stream
DataInputStream fs = new DataInputStream( FileInputStream("data.sly") );

// Read in the data
for(int i=0; i < 30; i++) {
String s = fs.readLine();
nums[i] = Integer.valueOf(s).intValue();
}
} catch (Exception e) {
// Catch any errors and exit
System.out.println("Error: " + e.toString);
System.exit(1);
}

int newNums[] = new int[30];
sync calcMe = new sync();

// Perform the data calculations
for(int y=0; y < 30; y++) {
int temp = calcMe.firstPass(nums[y]);
temp += 100;
newNums[y] = calcMe.secondPass(temp);
}

double total = 0;

// Calculate the total
for(int j=0; j < 30; j++) {
total =+ newNums[j];
}

// Final adjustments
total /= 13;
total += 700000;

// Print the result
System.out.println("Result:");
System.out.println((int) total);
}
}
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories