Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am getting these errors for my C++ code and don't understand why, how do I fix it? Code below it #ifndef HW2_U16106521_Q2_hpp #define HW2_U16106521_Q2_hpp

image text in transcribed

I am getting these errors for my C++ code and don't understand why, how do I fix it? Code below it

#ifndef HW2_U16106521_Q2_hpp

#define HW2_U16106521_Q2_hpp

#include

#include

using namespace std;

template

struct nodeType

{

Type info;

nodeType *link;

};

template

class linkedQueueType

{

public:

const linkedQueueType& operator=(const linkedQueueType&);

linkedQueueType(const linkedQueueType&);

bool isEmptyQueue() const;

bool isFullQueue() const;

void initalizationQueue();

Type front() const;

Type back() const;

void addQueue(const Type&);

void deleteQueue();

linkedQueueType();

~linkedQueueType();

int queueCount();

void print();

private:

nodeType *queueFront;

nodeType *queueRear;

int count;

void copyQueue(const linkedQueueType &);

};

#endif /* HW2_U16106521_Q2_hpp */

#include "HW2_U16106521_Q2.hpp"

#include

#include

using namespace std;

template

int linkedQueueType:: queueCount()

{

return count;

}

template

const linkedQueueType& linkedQueueType::operator=(const linkedQueueType&otherQueue)

{

if ( this != &otherQueue)

copyQueue( otherQueue);

return *this;

}

template

linkedQueueType::linkedQueueType (const linkedQueueType &otherQueue)

{

queueFront=NULL;

queueRear=NULL;

copyQueue(otherQueue);

}

template

void linkedQueueType::copyQueue (const linkedQueueType &otherQueue)

{

initalizationQueue();

nodeType *temp;

temp=otherQueue.queueFront;

while (temp != NULL)

{

addQueue(temp->info);

temp = temp->link;

}

}

template

bool linkedQueueType::isEmptyQueue() const

{

return (queueFront == NULL);

}

template

bool linkedQueueType::isFullQueue() const

{

return false;

}

template

void linkedQueueType::initalizationQueue()

{

nodeType *temp;

while (queueFront != NULL)

{

temp = queueFront;

queueFront = queueFront->link;

delete temp;

}

count = 0;

queueRear = NULL;

}

template

Type linkedQueueType::front() const

{

assert(queueFront != NULL);

return queueFront->info;

}

template

Type linkedQueueType::back() const

{

assert(queueRear != NULL);

return queueRear->info;

}

template

void linkedQueueType::addQueue(const Type& newElement)

{

nodeType *newNode;

newNode= new nodeType;

newNode->info = newElement;

newNode->link = NULL;

if ( queueFront == NULL)

queueFront = newNode;

else

queueRear->link = newNode;

queueRear = newNode;

count++;

}

template

void linkedQueueType::deleteQueue()

{

nodeType *temp;

if( !isEmptyQueue() )

{

temp = queueFront;

queueFront = queueFront->link;

delete temp;

count--;

if (queueFront == NULL)

queueFront = NULL;

}

else

cout

}

template

linkedQueueType::linkedQueueType()

{

queueFront = NULL;

queueRear = NULL;

count =0;

}

template

linkedQueueType::~linkedQueueType()

{

initalizationQueue();

}

template

void linkedQueueType::print()

{

nodeType *temp = queueFront;

while( temp != NULL)

{

cout info

temp = temp->link;

}

}

#include "HW2_U16106521_Q2.hpp"

#include

#include

using namespace std;

int main()

{

cout

linkedQueueType myQueue;

for( int i=1; i

myQueue.addQueue(i);

cout

myQueue.print();

cout

cout

myQueue.addQueue(11);

myQueue.addQueue(99);

cout

cout

system("pause");

return 0;

}

0 . . HW2-U 16 1 0652 1922My Mac Hw2 U16106521.02 | Build Hw2 U16106521 Q2: Failed | Today at 9:07 PMA 2 5 a D HW2. 6 1 0652 1.Q2 >rBuild Quick Help By Grcup By Time All Recent All Messages All Issues Errors Only Save... Filter HW2 U16106521 Q2 Build target HW2 U16106521 02 Project HW2 U16106521 42 Configuration Debug Destination My Mac I SDK macoS 10.13 No Quick Help Build Today, 9:07 PM Build Today, 9:06 PM Build Today, 9:06 PM Build Today, 9:05 PM Build Today, 8:36 PM Check dependencies 2 Search Decumentation MacOS deployment target '10.14' for architecture x8664'and variant 'normal' is greater than the maximum value '10.13.99' for the macoS 10.13S MacOS deployment target '10.14' for architecture x86.64'and variant 'normal' is greater than the maximum value '10.13.99' for the macoS 10.13S Compile HW2 U16106521.02.cppin Compile main.cpp ..i 16106521/HW2 U16106521 Q2/Hw2 U16106521 02 U16106521/HW2 U16106521 02HW2 U16106521 Q02 Project Link U16106521 02-aopizmgithpwscsufnktqcyckpk/Build/Products/Debug/Hw2... 6 'TinkedQueueType cints::queueCountil*, referenced from: main in main.o O linkedQueueTypeint:print(" referenced from: main in main.o 0 "linkedQueueTypecint ::addQueuelint const&), referenced from main in main.a linkedQueueTypecint:linkedQueueTypel) referenced from main in main.o 'inkedQueueTypecintlinkedQueueType0, reterenced trom: main in main.o Symbol(s) not found for architecture x86 64 Linker command failed with exit code 1 (usev to see invocation) Build failed 1118/18, 9:07 PM

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

Students also viewed these Databases questions