Question: KEY ITEMS: Key items are marked in red. Failure to include or complete key items will incur additional deductions as noted beside the item. Submission

 KEY ITEMS: Key items are marked in red. Failure to includeor complete key items will incur additional deductions as noted beside theitem. Submission and Grading: All project source code will be submitted inzyLabs. o Projects submitted after the due date are subject to the

KEY ITEMS: Key items are marked in red. Failure to include or complete key items will incur additional deductions as noted beside the item. Submission and Grading: All project source code will be submitted in zyLabs. o Projects submitted after the due date are subject to the late penalties described in the syllabus. Each submitted program will be graded with the rubric provided in eLearning as well as a set of test cases. These test cases will be posted in eLearning after the due date. o zyLabs will provide you with an opportunity to see how well your project works against the test cases. Although you cannot see the actual test cases, a description will be provided for each test case that should help you understand where your program fails. Type your name and netiD in the comments at the top of all files submitted. (-5 points) Objectives: Implement a linked list using classes in Java Implement input validation Perform sorting and search algorithms on a linked list Problem: Darth Vader wants to check that his TIE fighter pilots are patrolling adequately-sized regions of the galaxy. He has files of data that contain the patrol coordinates for each of his pilots. With the fear of being force choked, you have agreed to write a program that analyzes the data and determines the size of the area patrolled by the pilots in addition to providing the ability to search and sort the data. Pseudocode: Your pseudocode should describe the following items . For each function, identify the following o Determine the parameters o Determine the return type o Detail the step-by-step logic that the function will perform Functions o Linked List Sort function o Main class . Main function . Any additional functions that you plan to create Class Details: Use good programming practice for classes - proper variable access, mutators and accessors, proper constructors, etc. Remember that classes exist to be used by other people. Just because you don't use it in the program doesn't mean it shouldn't be coded and available for others to use in theirs. As with previous projects, you are open to design the classes as you see fit with the minimum requirements listed below All classes must be of your own design and implementation. O Do not use the pre-defined Java classes (-20 points if pre-defined classes used) Payload class - Payload.java o Must be comparable O Attributes Name (String) . Area (double) . Compare (boolean) Tracks type of comparison (compare by area or name) O Methods Default constructor Overloaded constructor Pass in pilot's name Accessors . Mutators Node class - Node.java o Must be generic o Must be comparable o No reference to anything inside Payload o Attributes . Generic variable to hold object Will be used to hold payload object in the progran Next pointer Prev pointer O Methods Default constructor Overloaded constructor Pass in generic object for payload Accessors for pointers Mutators for pointers Linked List - Linkedlist.java o No reference to anything inside Payload o Attributes Head pointer (points to beginning of list) Tail pointer (points to end of list) o Default constructor o Overloaded constructor Takes node and assigns head and tail to point at the node passed in o Accessor o Mutator o toString (overridden) . create a string that lists each pilot and their respective area separated on individual lines EXTRA CREDIT: Implement this recursively (5 points) o Sort Sort the linked list in ascending or descending order by name(alphabetical) or area(numerical) Only 1 sort function You must create a single function that can sort in ascending or descending order and can sort either names or areas . You may implement any sorting algorithm you prefer The sort implementation must rearrange the nodes Do not swap node contents (-10 points) Details: The area of the shape can be calculated with the following formula: 1/12 => (x+1+ x) i+1- y) Store each pilot's information (name and area) in a node in the linked list Add each new node to the end of the linked list The number of pilots in each file is unknown The number of coordinates for each pilot is unknown User Interface: There will be no user interface for this program. All I/O will be performed with files Input: . There will be 2 input files o Prompt the user for the name of the file containing the pilot routes first o Prompt the user for the name of the file containing the information Darth Vader needs Pilot route file o Read this file first Each line in the file will contain the pilot's first name followed by a list of coordinates o There will be a new line at the end of each line except for the last line which may or may not have a new line o The format for each line will be: , , ... , . The pilot's name may be multiple words. o Each line in the file will represent a different pilot. o The first and last set of coordinates will always be the same. A second input file will search and sort the data o Read this file second o Each line of the file will contain a command O Valid commands: sort sort the linked list on the given criteria Search the linked list for the given pilot o Output format if not found: not found If a sort is performed output the contents of the head and tail nodes o Output format: Head: , Tail: At the end of the program, write the linked list to a file named pilot_areas.txt. Use the LinkedList class' toString method o The area will be rounded to 2 decimal places

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!