The relationSpaceShips between the classes in this project is as follows:
(1) SpacePort has-many SpaceShip
(2) SpaceShip has-a Captain
(3) SpaceShip has-a Engine
(4) SpaceShip has-a RegistrationDate
(5) Impulse is-a Engine
(6) Warp is-a Engine

(7) SpaceShip has-many Crewman
(6) Person has-a pid (int)
(9) Person has-a DateOfBirth
(10) Captain is-a Officer
(11) Officer is-a Person

(12) DateOfBirth is-a StarDate
(13) RegistrationDate is-a StarDate
(14) StarDate has-a day (int)
(15) StarDate has-a month (int)
(16) StarDate has-a year (int)

(17) Enterprise is-a SpaceShip
(18) WarBird is-a SpaceShip
(19) RedShirt is-a Crewman
(20) Crewman is-a Person





NOTE:every object has:
private String objName, and
public String getName() {return objName;}


Create a test program that creates an SpacePort object, and prompts for
the user to enter the path of a data file. The program then reads the data from the data
file for the SpacePort.
Then, print:
1. all SpaceShip objects belonging to the SpacePort, sorted by getName(), and
2. all Person objects belonging to the SpacePort, sorted by getName()

Test your program by creating a data file and filling it in
with the data that answers the questions. Include the
data file and run.bat in the project folder.




Rules:
1. Each class above includes, in addition to the constructors:

public String toString(){
//return a string of the classname, the name, and toString() of all
parts.
}
public void readFromFile(){
//read the data from the user, including objName
}//readIn

2. The data members of each class MUST be declared "private" and you may not create
a public function that returns the value of any private data object, other than
getName() above.


3. All classes, except MainClass, should be in a package. Your project should have
at least 3 packages.


4. if you are reading in an element of class "C", where "C" is a superclass
of some other classes, then you must ask the user which of the subclasses
they want.

For example, suppose we have these relationSpaceShips:
Dealer has-many Car
Ford is-a Car
Honda is-a Car

then the readFromFile() function for Dealer might look like this:

Code:
 public void readFromFile(FileIO fio) thows Exception{
      if(fio.hasNextInt()==false){
	    throw new Exception("Dealer.readFromFile:missing ncars");
	  }
       int ncars = fio.getNextInt();
       carArray = new Car[ncars];
       for(int i=0;i<carArray.length;i++){
        if(fio.getNextLine()==false){
	      throw new Exception("Dealer.readFromFile:missing ncars");
	    }
        String cartype=fio.getNextLine();
        if(cartype.equals("f")){
          carArray[i]= new Ford();
        }else{
          carArray[i]= new Honda();
        }
        carArray[i].readFromFile(fio);
      }//for each car in carrArray
      
     }//readFromFile
	 
	 You may assume that class fileioPkg.FileIO is part of your project:
     package fileioPkg;
     import java.util.*;
     import java.io.*;
     public class FileIO {
	//this class acts as a static "producer" class that,after being
	//initialized with a filename,
	private FileReader freader;
	private Scanner scan=null;
	public FileIO(){
		freader=null;
		scan=null;
	}//default const
	public FileIO(String filename) throws FileNotFoundException{

		File infile;

		FileReader reader;		
		infile = new File(filename);

		reader = new FileReader(infile);
		scan = new Scanner(reader);
	}//(String) constructor
	public boolean hasNextInt() throws Exception{
		if(scan==null){
			throw new Exception("FileIO.getNextInt:file not opened");
		}else{
			return scan.hasNextInt();
		}
	}//hasNextInt
	public int getNextInt() throws Exception{
		if(scan==null){
			throw new Exception("FileIO.getNextInt:file not opened");
		}else{
			int iv=scan.nextInt();
			System.out.println("FileIO.getNextInt:"+iv);
			return iv;
		}
	}//getNextInt
	
	public boolean hasNextLine() throws Exception{
		if(scan==null){
			throw new Exception("FileIO.getNextInt:file not opened");
		}else{
			return scan.hasNextLine();
		}
	}//hasNextLine
	public String getNextLine() throws Exception{
		if(scan==null){
			throw new Exception("FileIO.getNextInt:file not opened");
		}else{
			String result=scan.nextLine().trim();
			System.out.println("FileIO.getNextLine:"+result);
			return result;
		}
	}//getNextLine

	
	public boolean hasNextDouble() throws Exception{
		if(scan==null){
			throw new Exception("FileIO.getNextInt:file not opened");
		}else{
			return scan.hasNextDouble();
		}
	}//hasNextDouble
	public double getNextDouble() throws Exception{
		if(scan==null){
			throw new Exception("FileIO.getNextInt:file not opened");
		}else{
			double dv=scan.nextDouble();
			System.out.println("FileIO.getNextDouble:"+dv);
			return dv;
		}
	}//getNextDouble
	public void close(){
		try {
			freader.close();
		} catch (IOException e) {
			//ignore
		}
	}//close

}//class FileIO
So far I created all the classes such as SpacePort, Crewman etc. I created the super classes for example SpaceShip extends SpacePort. I created a mainclass which asks the user to enter a txt file. But fromt his spot I am stuck on what I am so post to do. I have no idea how the txt file is supposed to look like and what the program is to do. Can someone please exaplin this to me in idiot proof terms. Sorry I am still new to java.