Unformatted text preview:

COP 3540 – Data Structures with OOPProject 2 – Fall 2011Due: October 3rd, 2011 (Monday)Drop Dead Date: October 5th, start of classPriority QueuesUsing NetBeans 7.0, you are to write a Java program using OOP principles to accommodate the following functionality Assignment #2Objectives:Provide student with additional experiences with file input output.Provide student with exercises in learning UMLProvide student with exercises in Javadoc and its various formatsProvide student with exercises in building an array of objects to support priority queuing.Provide student with experience in inserting, deleting, and searching priority queue of objects.Functionality: Given a sequential file, States.Fall2011.txt on my web page, you are to build a series of priority queues discussed ahead. You are specifically required to build four priority queues one for each Region based on Nbr of Region to group the states in each Region. Only consider states from regions 1, 2, 3, and 6. Please note that there is considerable additional data in the file that you may not need for this program. Do NOT eliminate it. Just don’t process it.The input data is not sorted in any way. As you read an input record from this file, create an object of type (class) State. Add this object to one of the four queues, depending on the NbrofRegion. As you insert() an object into its respective priority queue, the objects are to be in order by state population. Your insert() routine must reflect this. (This means that the states in each of the resulting priority queues will be ordered by state population.)You will note that at the conclusion of building your priority queues, each priorityqueue may well have a different number of objects within it. You must use an ArrayList() as your implementing data structure. Thus, in testing, if I change the number of entries in the input file, your program will still run successfully. (Please be sure to test this feature in your development efforts!)Once all six priority queues have been built, you are to display each of the queues in order (the priority queue for region 1 first, then 2, 3, and finally region 6) with an appropriate left justified header on your screen, such as New_England<skip a line> <note also, this is Region #1>Connecticut (these states are to be ordered by increasing population.)MaineMassachusettsNew HampshireRhode IslandVermont.Middle_AtlanticDelawareMarylandNew JerseyNew YorkPennsylvaniaVirginiaWest Virginiaetc.Please note that the states within each region are to be displayed in increasing population order.Once you have displayed the four priority queues, you are to open a transaction file callednewStates.txt. You are to read each of these input streams and build an array of objects. You are to put these entries in a stack. The format of the objects, however, should be the same as the format of the objects in the priority queues. You may use a stack size of 10 ifdesired.Once this stack is built, you are to display it in a professional manner – simply a text listing, left-justified and titled will be sufficient. So, this display may appear as the input from newStates.txt appears when you read it. Then, taking each of these entries, insert each into the appropriate priority queues using your same insert() algorithm you used when the priority queues were initially built.Display the updated priority queues in the same order as you did the original set.Bingo! You are done.Your zipped folder to me MUST include copies of the input files. I will need these to run your program and to test it. Do not provide me with output your program generates. I will get your program to generate your outputs. As noted, your outputs will be displayed on the screen. UMLYou are to include a UML class diagram. You may use Word or Power Point. Drag your UML design file into your P1 subfolder within your COP3538 desktop folder. It will be included in the zip file to me.JavadocAll programming is to be accompanied by appropriate Javadoc. Generate your Javadoc files and include the xxxxxxx file generated.You are to zip all files in your P2 as expected and Send them to me via the Assignment tab in Blackboard, as usual. Your project id should resemble project2broggio NOT project2n00010109.GradingSource Code – 20 pointsIndentationInternal commentsScope terminatorsOverall program structureProgram Architectural Design – 15 pointsUML: Correctness, associations, completeness. This means that the classes you identify are correct, that associations are indicated, and that the attributes and methods are documented within the classes.Program Detail Design – 15 pointsAppropriateness of the objects and their services providedInterface to objectsAttribute and method visibilityYou are to include your pseudo-code for your collection class (the one that contains the queues and stack) (15 points)Javadoc – 10 pointsAppropriateness and completeness of commentsALL methods must have Javadoc comments up front that are meaningful, please.Outputs – 40 pointsAccuracy and FormatSkip lines in between displayed numbers for readability.Include headers / descriptors as you may feel appropriate.Bonus: 10 points Optional!!Create a separate Input/Output class that handles all of your input and output to file processing. This means that you need to call a method in this class, pass it the name(s) of the input files, and let the methods in this class open and read the input streams from the two files. Please note that these methods are to be somewhat primitive. Please pass the strings read to the object that needs them to create a data object that will go into the queues. I suggest that you pass a string read back to main() and let main() pass the string to the collection class for processing. Thus after opening and validating a good open, you will be looping from main to getData() (say) in an Input/Output class method, string back to main() and string to the collection class to build object and insert() adjusting the array size.Done correctly, this is worth ten points. It is a ten or nothing, please. Program must run correctly to receive a passing grade and to receive at least partial credits above. If the program does not successfully run to end of job and include all major functional requirements, all bets are off.Start early and do this a little at a


View Full Document

UNF COP 3540 - Study Notes

Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?