Order the answer to: Hello computer science pros! The program’s purpose is to keep track of the arrival/departuretime of

Academic Help net programming Order the answer to: Hello computer science pros! The program’s purpose is to keep track of the arrival/departuretime of

net programming

Order the answer to: Hello computer science pros! The program’s purpose is to keep track of the arrival/departuretime of

Question Hello computer science pros!
The program’s purpose is to keep track of the arrival/departuretime of each customer who enters the bank (there is only oneteller/receptionist) using a queue and priorityqueue. The inputwill be given via a text file, and the output should be shown in aparticular way (like so: http://prntscr.com/mqrmpy). The input fileis: http://prntscr.com/mqrn06. I am asking from you pros totroubleshoot and fix my program so that it displays exactly asshown in the sample. I am 99% sure that the problem lies only inthe SimApp.cpp.
I will be here all day (and night) so do let me know in thecomments if you need more information. I’ve posted SimApp.cpp andPriorityQueue.h to an online text editor, because they were toolong for this question:https://www.writeurl.com/text/jrdp6p046idg3v7hx3co/26lv8260se265l2mwzd5/qr0xoz3ytlqp6m7qvmjn

#ifndef Event_h #define Event_h
class Event { private:    //Declare variables    char type;    unsigned int time;    unsigned int length;
   //Default constructor    Event(void);
   //Custom Constructor 1    Event(unsigned int inArrTime, unsigned intinLength);    //Custom Construcot 2    Event(char inType, unsigned int inArrTime, unsignedint inLength);
   //Destructor    ~Event();
   //Getters    char getType() const;    unsigned int getTime() const;    unsigned int getLength() const;    //Setters    int setType(char inType);    int setTime(unsigned int inArrTime);    int setLength(unsigned int inLength); }; #endif

#include “Event.h” #include
//Default constructor. Event::Event(void) : type(‘A’), time(0), length(0) {}
//Custom Constructor 1. Event::Event(unsigned int inArrTime, unsigned int inLength) :type(‘A’), time(inArrTime), length(inLength) {} //Custom constructor 2. Event::Event(char inType, unsigned int inArrTime, unsigned intinLength) : type(inType), time(inArrTime), length(inLength) {}
//Deconstructor Event::~Event() {}
//Definition for the getter method getType(). char Event::getType() const {    return type; //Return event type. } //Definition for the getter method getTime(). unsigned int Event::getTime() const {    return time; //Return customer arrival time. } //Definition for the getter method getLength(). unsigned int Event::getLength() const {    return length; //Return length of time. }
//Definition for the setter method setType(). int Event::setType(char inType) {    //Check whether the type is not A and D. (A=arrivaland D=departure)    if (inType != ‘A’ && inType != ‘D’)    {        return 1; //Invalid input.    }
   //Otherwise set type = inType    type = inType;
   return 0; //Return valid. } //Definition for the setter method setTime(). int Event::setTime(unsigned int inArrTime) {    //Check if time is a valid number, aka nonnegative    if (inArrTime    {        return 1; //Return invalid.    }
   //Otherwise set time = inArrTime    time = inArrTime;       return 0; //Return valid } //Definition for the setter method setLength(). int Event::setLength(unsigned int inLength) {    //Check whether the length of time is valid, akapositive.    if (inLength    {        return 1; //Return invalid.    }
   //Otherwise set length = inLength.    length = inLength;       return 0; //Return valid. }

#ifndef Node_h #define Node_h #include “Event.h”
template class Node { public:    //Declare a variable for node data.    type nData;
   //Declare a pointer for next node.    Node* nNext;
   //Default Constructor.    Node();
   //Custom Constructor 1.    Node(type inData);    //Custom Constructor 2.    Node(type inData, Node* inNextNode);
   //Destructor.    ~Node(); };
//Default constructor. template Node::Node() {    nNext = NULL; //Assign next pointer as null. }
//Custom Constructor 1. template Node::Node(type inData) {    //Initialize inData as iData.    nData = inData;    //Initialize null as nNext.    nNext = NULL; }
//Custom Constructor 2. template Node::Node(type inData, Node* inNextNode) {    //Assign inData as nData.    nData = inData;    //Assign inNextNode as nodeNext.    nNext = inNextNode; }
//Definition for destructor. template Node::~Node() {}

#ifndef Queue_h #define Queue_h #include “Event.h” #include “EmptyDataCollectionException.h” //Declare a constant variable. Can adjust this duringtesting. const unsigned int QUEUEMAX = 101;
template class Queue { private:    //Declare a variable for starting and endingposition.    unsigned int start;    unsigned int end;       type* qData; //pointer for queue data    public:    //Default constructor.    Queue();
   //Deconstructor.    ~Queue();
   //isEmpty() method – checks if queue isempty.    bool isEmpty() const;
   //Enqueue() method – inputs data into queue at theback.    bool Enqueue(const type& newqData);
   //Dequeue() method – removes data at front ofqueue.    bool Dequeue();
   //Peek() method – peek the data at front of queueand throws exception if queue is empty.    type Peek() constthrow(EmptyDataCollectionException); };
//Constructor. template Queue::Queue() : start(0), end(0), qData(NULL) {    //New queue.    qData = new Event[QUEUEMAX]; }
//Deconstructor. template Queue::~Queue() {    delete[] qData; //Clean memory.    qData = NULL; //Free data. }
//Definition for isEmpty(). template bool Queue::isEmpty() const {    //Check whether the queue is empty or not.    if (start == end)    {        //Empty.        return true;    }    //Otherwise, not empty.    return false; }
//Definition for Enqueue(). template bool Queue::Enqueue(const type& newqData) {    //Check whether the queue is full or not.    if ((start % QUEUEMAX) == (end + 1) % QUEUEMAX)    {        //If full returns false, exitsfunction.        return false;    }    //If not full, following occurs:    //Copy the data into array.    qData[(end) % QUEUEMAX] = newqData;    //Increment end position.    end++;    return true; }
//Definition for Dequeue(). template bool Queue::Dequeue() {    //Check whether the queue is empty or not.    if (isEmpty() == true)    {        return false;    }    start++;    return true; }
//Definition for Peek(). template type Queue::Peek() const throw(EmptyDataCollectionException) {    //Check whether the queue is empty or not.    if (start == end)    {        //Throw an exception.        throwEmptyDataCollectionException(“Queue is Empty”);    }
   //Return data at top of queue.    return qData[start % QUEUEMAX]; } #endif

#ifndef EmptyDataCollectionException_h #define EmptyDataCollectionException_h #include #include
using namespace std;
class EmptyDataCollectionException : public logic_error { public:    //Constructor.    EmptyDataCollectionException(const string& message= “”); }; #endif

#include “EmptyDataCollectionException.h” //Constructor. EmptyDataCollectionException::EmptyDataCollectionException(conststring& message) : logic_error(“Exception: ” + message) {}


Subject net programming
Ready to try a high quality writing service? Get a discount here