This is what I've done so far... I'm having trouble writing it to the file.
import java.io.*;
import java.util.Random;
public class Question3
{
public static void main(String[] args) throws IOException
{
Random rand = new Random();
FileWriter outFile = new FileWriter(args[0]);
PrintWriter out = new PrintWriter(outFile);
File file = new File("Exercise9_19.txt");
for( int counter = 0; counter < 100; counter++ )
{
int a = rand.nextInt(); //Makes random numbers fine
out.println(a); //Need to fix how to take "a" and place it onto the text file
}
out.close();
}
}


Sign In
Create Account


Back to top









