// a good starting shell for the first real program
import java.awt.*;
import java.net.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class Application1
{
public static void main(String[] args)
{
try
{
FileInputStream file_in = new FileInputStream("data1");
DataInputStream data_in = new DataInputStream(file_in);
char race, gender;
int age, weight;
int counter=0;
// declare the rest of your variables
do
{
race
= data_in.readChar();
gender = data_in.readChar();
age =
data_in.readInt();
weight = data_in.readInt();
// make all your decisions and add
to appropriate counters
counter ++;
}
while ( counter <10);
// do any averaging and print final results
} // end of try block
catch (IOException e )
{
JOptionPane.showMessageDialog(null,"file access problem");
}
System.exit(0);
}
}