Well, Mrs. Cynical, I think it is ok. I could use your feedback though. Let me know if anything jumps out at ya. Of course it won't all fit here
( ... )
/** * * @author Rob Holman */ public class DisplayStateFacts { // Initilaize Static variables, and declare the state array private static StateFact[] states = new StateFact[50]; static int i;
/** * @param args the command line arguments */ public static void main(String[] args) { //Fill the array with states using readFact method.
Comments 8
*snicker*
Reply
Reply
* CSC 240 Assignment 2: StateFacts App
* Spring 2009
*/
package displaystatefacts;
import java.io.*;
/**
*
* @author Rob Holman
*/
public class DisplayStateFacts
{
// Initilaize Static variables, and declare the state array
private static StateFact[] states = new StateFact[50];
static int i;
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
//Fill the array with states using readFact method.
BufferedReader inputStream = getReader("states.txt");
{ for (i = 0;i < 50 ;i++)
states[i] = readFact(inputStream);
}
// Handle Command-line arguments, match entered args to states in the array
// Use printf to format output in columns with fixed widths
if (args.length == 0)
{
System.out.printf("%-20s %-20s\n" , "State Name", "Capitol City");
System.out.println("=========================================");
for (i = 0;i < 50;i ( ... )
Reply
;o)
Reply
Leave a comment