MakeInflowFile - { try { Random gen = new Random();...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//********************************************************************* // MakeInflowFile.java Author: Lewis and Loftus // // Support for 8.8 solution. //********************************************************************* import java.io.*; import java.util.*; public class MakeInflowFile { //----------------------------------------------------------------- // Makes data file for hospital flow analysis program. //----------------------------------------------------------------- public static void main (String [] args)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { try { Random gen = new Random(); PrintWriter out = new PrintWriter ( new BufferedWriter ( new FileWriter ( new File (args[0])))); for (int week = 0; week < 4; week++) { for (int day = 0; day < 7; day++) { for (int hour = 0; hour < 24; hour++) out.print (gen.nextInt(5) + " "); out.println (); } out.println (); } out.close (); } catch (Exception ex) { ex.printStackTrace (System.err); System.out.println ("Usage: java MakeInflowFile filename"); } } }...
View Full Document

Ask a homework question - tutors are online