I really need help with a project that I have to write for my intro to Java programming class. I have absolutely no idea what to do or how to do it. I would appreciate any help or starts on the code or maybe, just maybe, a code for this in general. It's due soon (like, tonight at midnight) and I honestly have no idea at all. :/
Here are the instructions.
For Project 5, you will use Java to read complex data from a file into an array of objects and then sort it. You will become familiar with reading from a file, creating your own classes, arrays, and a simple sorting algorithm. This project uses concepts learned through chapters 1-6 and 8.
You have a choice about what your final project will concern. The three options are:
- Sports team roster (softball, ultimate, soccer, or any team sport)
o Database file: Team.txt
o The file contains jersey numbers and player names
- Book collection
o Database file: Books.txt
o The file contains year published and title
- Pet store inventory
o Database file: Pets.txt
o The file contains count and type of pet
You will create a class for your project. For example, if you are doing the book collection option, your class might be "Book". The class that you create should have 2 private data fields corresponding to the data in the database file. The class must have a constructor with 2 parameters and accessor methods for each data field.
You will create a separate class that will hold your main method, a method to read the contents of the file into an array, a method list the contents of an array, and 2 sorting methods. All methods in this class can and should be "public static". The main method should look a lot like this:
Initialize array of objects
Read data from file into array
List data in array (unsorted)
Sort data alphabetically
List data in array (now sorted alphabetically)
Sort data numerically
List data in array (now sorted numerically)
The listing of the database should be formatted nicely and look something like the following:
Player Jersey Number
Thank you for any and all help.