In this lab you will implement a Priority Queue from a Heap. You will use your Priority Queue with the student class to output the students two different ways.
You are provided with 10 files:
PriorityQueueDriver.cpp
Key.h
Heap.h
Priority.h
PriorityQueue.h
Classification.h
Classification.cpp
Student.h
Student.cpp
students.txt
You will need to implement the following: an abstract class Priority in Priority.h, a priority queue in PriorityQueue.h, and the main program in PrioirtyQueueDriver.cpp. The files Key.h, Heap.h, Classification.h, Classification.cpp, Student.h and Student.cpp have been coded and are read only. You do not need to make an implementation changes to these files. The definition for the PriorityQueue class is already coded for you. You will need to code up the method implementations.
Part 1: Complete Priority.h
In the file Priority.h, you should declare two pure virtual methods that will be used by the priority queue. Make sure you do each of the following.
1 Write a method declaration for the getter. Use the signature virtual int getPriority() = 0;
2 Write a method declaration for the setter. Use the signature virtual void setPriority(int priority) = 0;
Note: This abstract class will only have two methods.
Part 2: Implement the PriorityQueue class
In the file PriorityQueue.h, you should implement a generic priority queue. Make sure you do each of the following.
Note: The class definition is already completed. A generic Heap is being used to store your nodes for the priority queue. The two constructors for the class have also been completed. You need to complete the implementation of the methods below the constructors.
Part 3: Implement PriorityQueueDriver functions “`main()“` and “`heapSort()“`
In the file PriorityQueueDriver.cpp implement the functions main() and heapSort().
1
int main()
You should do the following in main
1. Declare a PriorityQueue
2. Pass your PrioirtyQueue variable to readInData(…)
3. Pass the value true to the Student class method setUsePriority(…)
4. Output all the students in priority order (See output example below).
Note: Before output any data, execute the following code: cout