Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The primary objective of this program is to implement a linked list. The secondary objective is to practice with File I/O and arrays. Prog escription

image text in transcribed

image text in transcribed

The primary objective of this program is to implement a linked list. The secondary objective is to practice with File I/O and arrays. Prog escription Write a program to manage the distribution of health practitioners among the vaccination centers. You are required to write the following important methods: 1. Write a function to add a practitioner to the specified center at the end of the linked list) 2. Write a function to search for the practitioner based on his id. 3. Write a function that removes the left practitioner for specified center (linked list) into a new linked list that represents the left practitioners. 4. Write a function that delete the node from the linked list based on the practitioner id. The program deals with three files. Two input files and one output file. The description of these files as follow: The first input file (intiallformation.Ext) contains the important information for the system which includes the number of centers, capacities of each center, and practitioners information. The information in this file are arranged as follow The first line contains number of centers, and the capacities of all centers. The second line contains the centers names The remaining lines contain the health pratitioners information(d, first name, last name) The commands for the system are found in the second file called commands. The commands in this file as follow: O STARTUP: This command will use the first input file (intellformation. to initialize the system by creating numbers of linked lists equal to the number of centers specified in the file (every linked list holds the health practitioners of one center). Then, it will distribute the health practitioners among the created lists based on capacities specified in the first line which started from the second number on the line DISPLAY_ALL_CENTERS: This command will display the health practitioners in all centers similar to the output in the owpopul.txt file NUM_PRACTIONERS: This command has one value that determines the center number. It will display the number of health practitioners in the specified center DISPLAY: This command has one value that determines the center number. It will display all health practitioners in the specified center. DISPLAY ALL_BASED ON STATUS: This command will display the health practitioners in all centers based on the required status (Exist, Moved, Left). If the required statul in not found it will display the "Not found any practitioners of the status status message DISPLAY_BASED_ON_STATUS: This command will display the health practitioners in specific center based on the required status (Exist, Moved. Left). If the required status in not found it will display the "Not found any practitioners of the status status in center number message LEAVE_THE_JOB: This command has one value that represents the practitioner id who will leave the center. The command will search for this practitioner in all linked lists and change him his status to Left REMOVE ALL LEFT PRACTITIONERS: This command will delete all left practitioners from all centers (linked lists) and add them to the new linked list that contains all the left practitioners MOVE: This command has two values, the first value represents the practitioner id to be moved and the second value represents the required center for moving. The command will search for this practitioner in all linked lists, remove it from the current centerlinked list), add him her to the required center and change him his status to Mowed. O DELETE CENTER: This command has one value that determines the center number. It will delete the whole specified center MERGE: This command will merge all the remainings linked lists to a new one QUIT: This command will stop the program The output of the program should be written to the file name it out but which content should be similar to the contents of the file provided to you Implementation For this program, you will create the following classes Practitioner juw: This class will be used to create objects of type practitioner Each practitioner object will store the practitioner id, practitioner first time, practitioner last name, centrumber, alus (Exist, Moved, Left). Center java: All the methods will be implemented in this class Main Program java. This is the class that will contain the main Sample Input & Output We have provided you a sample for two input files and one output file ***WARNING Your program MUST adhere to the EXACT format shown in the sample output file spacing capitalization, use of dollar signs, periods, punctuation, te). The graders will large input files, resulting in large output files. As such, the graders will use text comparison programs to compare your output to the correct output. If, for example, you have to spices between in the output when there should be only one space, this will show up as an error even though you may have the program correct. You will get points off if this is the case, which is why this is being explained in detail. The minimum deduction will be 10% of the grade, as the graders will be forced to go to the text editing of your program in order to give you accurate grade. Again, your output MUST ADIERE EXACTLY to the sample output The primary objective of this program is to implement a linked list. The secondary objective is to practice with File I/O and arrays. Prog escription Write a program to manage the distribution of health practitioners among the vaccination centers. You are required to write the following important methods: 1. Write a function to add a practitioner to the specified center at the end of the linked list) 2. Write a function to search for the practitioner based on his id. 3. Write a function that removes the left practitioner for specified center (linked list) into a new linked list that represents the left practitioners. 4. Write a function that delete the node from the linked list based on the practitioner id. The program deals with three files. Two input files and one output file. The description of these files as follow: The first input file (intiallformation.Ext) contains the important information for the system which includes the number of centers, capacities of each center, and practitioners information. The information in this file are arranged as follow The first line contains number of centers, and the capacities of all centers. The second line contains the centers names The remaining lines contain the health pratitioners information(d, first name, last name) The commands for the system are found in the second file called commands. The commands in this file as follow: O STARTUP: This command will use the first input file (intellformation. to initialize the system by creating numbers of linked lists equal to the number of centers specified in the file (every linked list holds the health practitioners of one center). Then, it will distribute the health practitioners among the created lists based on capacities specified in the first line which started from the second number on the line DISPLAY_ALL_CENTERS: This command will display the health practitioners in all centers similar to the output in the owpopul.txt file NUM_PRACTIONERS: This command has one value that determines the center number. It will display the number of health practitioners in the specified center DISPLAY: This command has one value that determines the center number. It will display all health practitioners in the specified center. DISPLAY ALL_BASED ON STATUS: This command will display the health practitioners in all centers based on the required status (Exist, Moved, Left). If the required statul in not found it will display the "Not found any practitioners of the status status message DISPLAY_BASED_ON_STATUS: This command will display the health practitioners in specific center based on the required status (Exist, Moved. Left). If the required status in not found it will display the "Not found any practitioners of the status status in center number message LEAVE_THE_JOB: This command has one value that represents the practitioner id who will leave the center. The command will search for this practitioner in all linked lists and change him his status to Left REMOVE ALL LEFT PRACTITIONERS: This command will delete all left practitioners from all centers (linked lists) and add them to the new linked list that contains all the left practitioners MOVE: This command has two values, the first value represents the practitioner id to be moved and the second value represents the required center for moving. The command will search for this practitioner in all linked lists, remove it from the current centerlinked list), add him her to the required center and change him his status to Mowed. O DELETE CENTER: This command has one value that determines the center number. It will delete the whole specified center MERGE: This command will merge all the remainings linked lists to a new one QUIT: This command will stop the program The output of the program should be written to the file name it out but which content should be similar to the contents of the file provided to you Implementation For this program, you will create the following classes Practitioner juw: This class will be used to create objects of type practitioner Each practitioner object will store the practitioner id, practitioner first time, practitioner last name, centrumber, alus (Exist, Moved, Left). Center java: All the methods will be implemented in this class Main Program java. This is the class that will contain the main Sample Input & Output We have provided you a sample for two input files and one output file ***WARNING Your program MUST adhere to the EXACT format shown in the sample output file spacing capitalization, use of dollar signs, periods, punctuation, te). The graders will large input files, resulting in large output files. As such, the graders will use text comparison programs to compare your output to the correct output. If, for example, you have to spices between in the output when there should be only one space, this will show up as an error even though you may have the program correct. You will get points off if this is the case, which is why this is being explained in detail. The minimum deduction will be 10% of the grade, as the graders will be forced to go to the text editing of your program in order to give you accurate grade. Again, your output MUST ADIERE EXACTLY to the sample output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Management And Cost Accounting

Authors: Colin Drury

6th Edition

1844807037, 978-1844807031

More Books

Students also viewed these Accounting questions

Question

List and describe three behavioral leadership theories.

Answered: 1 week ago