Question: Objective: Write a program which will generate a sheep shearing schedule based on a given file and priority scheduling. Only one sheep can be sheared
Objective:
Write a program which will generate a sheep shearing schedule based on a given file and priority scheduling. Only one sheep can be sheared at a time and the other sheep must wait to be sheared. While the other sheep are waiting, they are prioritized by smaller shearing times and then by their name in alphabetical order. The next sheep to be sheared has the highest priority.
Requirements:
Functionality. pts
No Syntax, Major RunTime, or Major Logic Errors. pts
Code that cannot be compiled due to syntax errors is nonfunctional code and will receive no points for this entire section.Code that cannot be executed or tested due to major runtime or logic errors is nonfunctional code and will receive no points for this entire section.
Use only a Heap of your own creation. pts
Other Java builtin types ArrayLists, LinkedLists, Queues, etc will receive no points for this entire section.
Reading a Sheep Scheduling File pts
The program must be able to read a sheep scheduling file that has the format:
tt
The user must be able to provide the name of the file.
Use the given file to test your solution.
All above must apply for full credit.
Sheep Information pts
Each sheep has a name, shearing time, and arrival time.Sheep must be comparable by their shearing time, and by their name. All assume ascending order.All above must apply for full credit.
Sheep Wait Heap pts
The program must use a generic implementation of a MinHeap, of ones own creation, to schedule the sheep who are waiting.
If a builtin Java heap is used, then no points will be awarded for functionality pts
This MinHeap must have both add and remove implemented properly.After every operation the MinHeap must remain a MinHeap.All the above must apply for full credit.
Scheduling Sheep pts
The program must then simulate and print to the console a sheep shearing schedule using the sheep found in the file.The first sheep to arrive is the first sheep to be sheared. While that sheep is being sheared if other sheep arrive, then they are put into the sheep wait heap and prioritized based on their shearing time and their name alphabetically.Only sheep who have arrived and who are waiting are added to the sheep heap.Once the last sheep has been sheared and the sheep heap is empty, then the program must print the schedule to the console and ask the user if they would like to run it again.All above must apply for full credit.
Coding Style. pts
Code functionality organized within multiple methods other than the main method, and methods organized within multiple classes where appropriate. ptsReadable Code pts
Meaningful identifiers for data and methods.Proper indentation that clearly identifies statements within the body of a class, a method, a branching statement, a loop statement, etc.All the above must apply for full credit.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
