Hello all,
I am making a program that takes user entered amounts and makes a table of random numbers..
However,
I am trying to make the user entered amounts show up in the terminal window and output file...I cannot figure this out after hours of trying.
Someone PLEASE help!
I will really appreciate..
here is my current code
It is printing fine in the terminal window but not the output file..I need the same thing in the terminal and output ||
rnumber = randomGenerator.nextInt(hnumber); System.out.println(); int counter = rnumber; for (int rows = 1; rows <= rownumber; ++rows) { for (int columns = 1; columns <= cnumber; ++columns) { rnumber = randomGenerator.nextInt(hnumber); rnumber++; System.out.printf("%4d", rnumber); PrintWriter myOut; try { myOut = new PrintWriter (new FileOutputStream("out6.dat")); myOut.printf("%4d", rnumber); } System.out.println(); } myOut.close(); } catch (IOException e) { System.out.println("exception is "+e.getMessage()); }