SlideShare a Scribd company logo
Pleae help me with this C++ question, ill upvote thanks.
Write the definitions of the functions of the class orderedArrayListType that are not given in this
chapter.
please write a main.cpp and orderedArrayListTypeImp.cpp file and all the file that is given is
everything i have for this task
main.cpp
#include
#include "unorderedArrayListType.h"
using namespace std;
int main() {
// Write your main here
return 0;
}
////////////
orderedArrayListType.h
#ifndef H_orderedArrayListType
#define H_orderedArrayListType
#include "arrayListType.h"
class orderedArrayListType: public arrayListType
{
public:
void insertAt(int location, int insertItem);
void insertEnd(int insertItem);
void replaceAt(int location, int repItem);
int seqSearch(int searchItem) const;
void insert(int insertItem);
void remove(int removeItem);
orderedArrayListType(int size = 100);
//Constructor
};
#endif
/////////////////
orderedArrayListTypeImp.cpp
/////////////////////////////
arrayListType.h
#include
#include "orderedArrayListType.h"
using namespace std;
void orderedArrayListType::insert(int insertItem)
{
if (length == 0) //list is empty
list[length++] = insertItem; //insert insertItem
//and increment length
else if (length == maxSize)
cout << "Cannot insert in a full list." << endl;
else
{
//Find the location in the list where to insert
//insertItem.
int loc;
bool found = false;
for (loc = 0; loc < length; loc++)
{
if (list[loc] >= insertItem)
{
found = true;
break;
}
}
for (int i = length; i > loc; i--)
list[i] = list[i - 1]; //move the elements down
list[loc] = insertItem; //insert insertItem
length++; //increment the length
}
} //end insert
int orderedArrayListType::seqSearch(int searchItem) const
{
int loc;
bool found = false;
for (loc = 0; loc < length; loc++)
{
if (list[loc] >= searchItem)
{
found = true;
break;
}
}
if (found)
{
if (list[loc] == searchItem)
return loc;
else
return -1;
}
else
return -1;
} //end seqSearch
void orderedArrayListType::insertAt(int location, int insertItem)
{
if (location < 0 || location >= maxSize)
cout << "The position of the item to be "
<< "inserted is out of range." << endl ;
else if (length == maxSize) //list is full
cout << "Cannot insert in a full list." << endl;
else
{
cout << "This is a sorted list. Inserting at the proper place."
<< endl;
insert(insertItem);
}
} //end insertAt
void orderedArrayListType::insertEnd(int insertItem)
{
if (length == maxSize) //the list is full
cout << "Cannot insert in a full list." << endl;
else
{
cout << "This is a sorted list. Inserting at the proper "
<< "place." << endl;
insert(insertItem);
}
} //end insertEnd
void orderedArrayListType::replaceAt(int location, int repItem)
{
if (location < 0 || location >= length)
cout << "The location of the item to be replaced is out "
<< "of range." << endl;
else
{
removeAt(location);
insert(repItem);
}
} //end replaceAt
void orderedArrayListType::remove(int removeItem)
{
int loc;
if (length == 0)
cout << "Cannot delete from an empty list." << endl;
else
{
loc = seqSearch(removeItem);
if (loc != -1)
removeAt(loc);
else
cout << "The item to be deleted is not in the list." << endl;
}
} //end remove
orderedArrayListType::orderedArrayListType(int size)
: arrayListType(size)
{
}
/////////////////
arrayListTypeImp.cpp
#include
#include "arrayListType.h"
using namespace std;
bool arrayListType::isEmpty() const
{
return (length == 0);
} //end isEmpty
bool arrayListType::isFull() const
{
return (length == maxSize);
} //end isFull
int arrayListType::listSize() const
{
return length;
} //end listSize
int arrayListType::maxListSize() const
{
return maxSize;
} //end maxListSize
void arrayListType::print() const
{
for (int i = 0; i < length; i++)
cout << list[i] << " ";
cout << endl;
} //end print
bool arrayListType::isItemAtEqual(int location, int item) const
{
if (location < 0 || location >= length)
{
cout << "The location of the item to be removed "
<< "is out of range." << endl;
return false;
}
else
return (list[location] == item);
} //end isItemAtEqual
void arrayListType::removeAt(int location)
{
if (location < 0 || location >= length)
cout << "The location of the item to be removed "
<< "is out of range." << endl;
else
{
for (int i = location; i < length - 1; i++)
list[i] = list[i+1];
length--;
}
} //end removeAt
void arrayListType::retrieveAt(int location, int& retItem) const
{
if (location < 0 || location >= length)
cout << "The location of the item to be retrieved is "
<< "out of range" << endl;
else
retItem = list[location];
} //end retrieveAt
void arrayListType::clearList()
{
length = 0;
} //end clearList
arrayListType::arrayListType(int size)
{
if (size <= 0)
{
cout << "The array size must be positive. Creating "
<< "an array of the size 100." << endl;
maxSize = 100;
}
else
maxSize = size;
length = 0;
list = new int[maxSize];
} //end constructor
arrayListType::~arrayListType()
{
delete [] list;
} //end destructor
arrayListType::arrayListType(const arrayListType& otherList)
{
maxSize = otherList.maxSize;
length = otherList.length;
list = new int[maxSize]; //create the array
for (int j = 0; j < length; j++) //copy otherList
list [j] = otherList.list[j];
}//end copy constructor

More Related Content

Similar to Pleae help me with this C++ question, ill upvote thanks.Write the .pdf

helpInstructionsAdd the function max as an abstract function to .pdf
helpInstructionsAdd the function max as an abstract function to .pdfhelpInstructionsAdd the function max as an abstract function to .pdf
helpInstructionsAdd the function max as an abstract function to .pdf
almonardfans
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
arshin9
 
Using the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdfUsing the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdf
mallik3000
 
#ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
 #ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf #ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
#ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
angelsfashion1
 
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdfAnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
anwarsadath111
 
Complete the provided partial C++ Linked List program. Main.cpp is g.pdf
Complete the provided partial C++ Linked List program. Main.cpp is g.pdfComplete the provided partial C++ Linked List program. Main.cpp is g.pdf
Complete the provided partial C++ Linked List program. Main.cpp is g.pdf
rajkumarm401
 
How do I declare the following constructors in my .h file Below.pdf
How do I declare the following constructors in my .h file Below.pdfHow do I declare the following constructors in my .h file Below.pdf
How do I declare the following constructors in my .h file Below.pdf
Conint29
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
DIPESH30
 
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
davidwarner122
 
My question is pretty simple, I just want to know how to call my ope.pdf
My question is pretty simple, I just want to know how to call my ope.pdfMy question is pretty simple, I just want to know how to call my ope.pdf
My question is pretty simple, I just want to know how to call my ope.pdf
jeetumordhani
 
#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx
gertrudebellgrove
 
maincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdfmaincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdf
abiwarmaa
 
1- The design of a singly-linked list below is a picture of the functi (1).pdf
1- The design of a singly-linked list below is a picture of the functi (1).pdf1- The design of a singly-linked list below is a picture of the functi (1).pdf
1- The design of a singly-linked list below is a picture of the functi (1).pdf
afgt2012
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdf
ravikapoorindia
 
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
ajoy21
 
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docx
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docxRightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docx
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docx
joellemurphey
 
Please teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdfPlease teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdf
amarndsons
 

Similar to Pleae help me with this C++ question, ill upvote thanks.Write the .pdf (20)

helpInstructionsAdd the function max as an abstract function to .pdf
helpInstructionsAdd the function max as an abstract function to .pdfhelpInstructionsAdd the function max as an abstract function to .pdf
helpInstructionsAdd the function max as an abstract function to .pdf
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
 
Using the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdfUsing the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdf
 
#ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
 #ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf #ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
#ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
 
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdfAnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
 
Complete the provided partial C++ Linked List program. Main.cpp is g.pdf
Complete the provided partial C++ Linked List program. Main.cpp is g.pdfComplete the provided partial C++ Linked List program. Main.cpp is g.pdf
Complete the provided partial C++ Linked List program. Main.cpp is g.pdf
 
How do I declare the following constructors in my .h file Below.pdf
How do I declare the following constructors in my .h file Below.pdfHow do I declare the following constructors in my .h file Below.pdf
How do I declare the following constructors in my .h file Below.pdf
 
강의자료7
강의자료7강의자료7
강의자료7
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
 
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
 
My question is pretty simple, I just want to know how to call my ope.pdf
My question is pretty simple, I just want to know how to call my ope.pdfMy question is pretty simple, I just want to know how to call my ope.pdf
My question is pretty simple, I just want to know how to call my ope.pdf
 
#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx
 
maincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdfmaincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdf
 
1- The design of a singly-linked list below is a picture of the functi (1).pdf
1- The design of a singly-linked list below is a picture of the functi (1).pdf1- The design of a singly-linked list below is a picture of the functi (1).pdf
1- The design of a singly-linked list below is a picture of the functi (1).pdf
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdf
 
PathOfMostResistance
PathOfMostResistancePathOfMostResistance
PathOfMostResistance
 
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
 
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docx
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docxRightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docx
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docx
 
Please teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdfPlease teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdf
 
강의자료10
강의자료10강의자료10
강의자료10
 

More from vinodagrawal6699

Please answer it as soon as possible Chapter 2- Part 2 Link Stat.pdf
Please answer it as soon as possible  Chapter 2- Part 2 Link Stat.pdfPlease answer it as soon as possible  Chapter 2- Part 2 Link Stat.pdf
Please answer it as soon as possible Chapter 2- Part 2 Link Stat.pdf
vinodagrawal6699
 
Please answer in Arm assembly language The file palindrome.s conta.pdf
Please answer in Arm assembly language The file palindrome.s conta.pdfPlease answer in Arm assembly language The file palindrome.s conta.pdf
Please answer in Arm assembly language The file palindrome.s conta.pdf
vinodagrawal6699
 
Please answer in Arm assembly languageThe file palindrome.s contai.pdf
Please answer in Arm assembly languageThe file palindrome.s contai.pdfPlease answer in Arm assembly languageThe file palindrome.s contai.pdf
Please answer in Arm assembly languageThe file palindrome.s contai.pdf
vinodagrawal6699
 
please answer detail thank you 5 .Deontology and consequentialism .pdf
please answer detail thank you 5 .Deontology and consequentialism .pdfplease answer detail thank you 5 .Deontology and consequentialism .pdf
please answer detail thank you 5 .Deontology and consequentialism .pdf
vinodagrawal6699
 
Please answer based on the requirements written in the photo.Pro.pdf
Please answer based on the requirements written in the photo.Pro.pdfPlease answer based on the requirements written in the photo.Pro.pdf
Please answer based on the requirements written in the photo.Pro.pdf
vinodagrawal6699
 
Please answer based on the requirements written in the photo.Prepa.pdf
Please answer based on the requirements written in the photo.Prepa.pdfPlease answer based on the requirements written in the photo.Prepa.pdf
Please answer based on the requirements written in the photo.Prepa.pdf
vinodagrawal6699
 
Playground Project PlanYou have been asked to create a project pla.pdf
Playground Project PlanYou have been asked to create a project pla.pdfPlayground Project PlanYou have been asked to create a project pla.pdf
Playground Project PlanYou have been asked to create a project pla.pdf
vinodagrawal6699
 
Plasmids do all of the following EXCEPTO have their own initiation.pdf
Plasmids do all of the following EXCEPTO have their own initiation.pdfPlasmids do all of the following EXCEPTO have their own initiation.pdf
Plasmids do all of the following EXCEPTO have their own initiation.pdf
vinodagrawal6699
 
plan de atenci�n de enfermer�a para Linda Pittmon, una paciente de 7.pdf
plan de atenci�n de enfermer�a para Linda Pittmon, una paciente de 7.pdfplan de atenci�n de enfermer�a para Linda Pittmon, una paciente de 7.pdf
plan de atenci�n de enfermer�a para Linda Pittmon, una paciente de 7.pdf
vinodagrawal6699
 
Physicians� Hospital has the following balances on December 31, 2024.pdf
Physicians� Hospital has the following balances on December 31, 2024.pdfPhysicians� Hospital has the following balances on December 31, 2024.pdf
Physicians� Hospital has the following balances on December 31, 2024.pdf
vinodagrawal6699
 
Peter arrend� un espacio de oficina comercial al arrendador sobre la.pdf
Peter arrend� un espacio de oficina comercial al arrendador sobre la.pdfPeter arrend� un espacio de oficina comercial al arrendador sobre la.pdf
Peter arrend� un espacio de oficina comercial al arrendador sobre la.pdf
vinodagrawal6699
 
Philip Brickell, a forty-three-year-old employee of the London Under.pdf
Philip Brickell, a forty-three-year-old employee of the London Under.pdfPhilip Brickell, a forty-three-year-old employee of the London Under.pdf
Philip Brickell, a forty-three-year-old employee of the London Under.pdf
vinodagrawal6699
 
Periferik tolerans, bariyer bakl i�in neden kritiktir A) Uygun .pdf
Periferik tolerans, bariyer bakl i�in neden kritiktir A) Uygun .pdfPeriferik tolerans, bariyer bakl i�in neden kritiktir A) Uygun .pdf
Periferik tolerans, bariyer bakl i�in neden kritiktir A) Uygun .pdf
vinodagrawal6699
 
paypal i�in sorular Paypaln profili nedir Kullanm nasl.pdf
paypal i�in sorular Paypaln profili nedir Kullanm nasl.pdfpaypal i�in sorular Paypaln profili nedir Kullanm nasl.pdf
paypal i�in sorular Paypaln profili nedir Kullanm nasl.pdf
vinodagrawal6699
 
Paul Casey se retir� de la Marina de los EE. UU. en 2013. Recibe una.pdf
Paul Casey se retir� de la Marina de los EE. UU. en 2013. Recibe una.pdfPaul Casey se retir� de la Marina de los EE. UU. en 2013. Recibe una.pdf
Paul Casey se retir� de la Marina de los EE. UU. en 2013. Recibe una.pdf
vinodagrawal6699
 
Party Supply Inc. a calender year corporation, took a physical inven.pdf
Party Supply Inc. a calender year corporation, took a physical inven.pdfParty Supply Inc. a calender year corporation, took a physical inven.pdf
Party Supply Inc. a calender year corporation, took a physical inven.pdf
vinodagrawal6699
 
Parte 1 �Cu�l es el capital contable total de la Entidad A con bas.pdf
Parte 1 �Cu�l es el capital contable total de la Entidad A con bas.pdfParte 1 �Cu�l es el capital contable total de la Entidad A con bas.pdf
Parte 1 �Cu�l es el capital contable total de la Entidad A con bas.pdf
vinodagrawal6699
 
PART I Think about the best and worst companies you know. What is e.pdf
PART I Think about the best and worst companies you know. What is e.pdfPART I Think about the best and worst companies you know. What is e.pdf
PART I Think about the best and worst companies you know. What is e.pdf
vinodagrawal6699
 
Part AToday, theUS dollaris trading at 4.60, compared to 4.20 ayea.pdf
Part AToday, theUS dollaris trading at 4.60, compared to 4.20 ayea.pdfPart AToday, theUS dollaris trading at 4.60, compared to 4.20 ayea.pdf
Part AToday, theUS dollaris trading at 4.60, compared to 4.20 ayea.pdf
vinodagrawal6699
 
Parann d�ng�s� nedir Para d�ng�s�ne kimler katlyor Finansal bir il.pdf
Parann d�ng�s� nedir Para d�ng�s�ne kimler katlyor Finansal bir il.pdfParann d�ng�s� nedir Para d�ng�s�ne kimler katlyor Finansal bir il.pdf
Parann d�ng�s� nedir Para d�ng�s�ne kimler katlyor Finansal bir il.pdf
vinodagrawal6699
 

More from vinodagrawal6699 (20)

Please answer it as soon as possible Chapter 2- Part 2 Link Stat.pdf
Please answer it as soon as possible  Chapter 2- Part 2 Link Stat.pdfPlease answer it as soon as possible  Chapter 2- Part 2 Link Stat.pdf
Please answer it as soon as possible Chapter 2- Part 2 Link Stat.pdf
 
Please answer in Arm assembly language The file palindrome.s conta.pdf
Please answer in Arm assembly language The file palindrome.s conta.pdfPlease answer in Arm assembly language The file palindrome.s conta.pdf
Please answer in Arm assembly language The file palindrome.s conta.pdf
 
Please answer in Arm assembly languageThe file palindrome.s contai.pdf
Please answer in Arm assembly languageThe file palindrome.s contai.pdfPlease answer in Arm assembly languageThe file palindrome.s contai.pdf
Please answer in Arm assembly languageThe file palindrome.s contai.pdf
 
please answer detail thank you 5 .Deontology and consequentialism .pdf
please answer detail thank you 5 .Deontology and consequentialism .pdfplease answer detail thank you 5 .Deontology and consequentialism .pdf
please answer detail thank you 5 .Deontology and consequentialism .pdf
 
Please answer based on the requirements written in the photo.Pro.pdf
Please answer based on the requirements written in the photo.Pro.pdfPlease answer based on the requirements written in the photo.Pro.pdf
Please answer based on the requirements written in the photo.Pro.pdf
 
Please answer based on the requirements written in the photo.Prepa.pdf
Please answer based on the requirements written in the photo.Prepa.pdfPlease answer based on the requirements written in the photo.Prepa.pdf
Please answer based on the requirements written in the photo.Prepa.pdf
 
Playground Project PlanYou have been asked to create a project pla.pdf
Playground Project PlanYou have been asked to create a project pla.pdfPlayground Project PlanYou have been asked to create a project pla.pdf
Playground Project PlanYou have been asked to create a project pla.pdf
 
Plasmids do all of the following EXCEPTO have their own initiation.pdf
Plasmids do all of the following EXCEPTO have their own initiation.pdfPlasmids do all of the following EXCEPTO have their own initiation.pdf
Plasmids do all of the following EXCEPTO have their own initiation.pdf
 
plan de atenci�n de enfermer�a para Linda Pittmon, una paciente de 7.pdf
plan de atenci�n de enfermer�a para Linda Pittmon, una paciente de 7.pdfplan de atenci�n de enfermer�a para Linda Pittmon, una paciente de 7.pdf
plan de atenci�n de enfermer�a para Linda Pittmon, una paciente de 7.pdf
 
Physicians� Hospital has the following balances on December 31, 2024.pdf
Physicians� Hospital has the following balances on December 31, 2024.pdfPhysicians� Hospital has the following balances on December 31, 2024.pdf
Physicians� Hospital has the following balances on December 31, 2024.pdf
 
Peter arrend� un espacio de oficina comercial al arrendador sobre la.pdf
Peter arrend� un espacio de oficina comercial al arrendador sobre la.pdfPeter arrend� un espacio de oficina comercial al arrendador sobre la.pdf
Peter arrend� un espacio de oficina comercial al arrendador sobre la.pdf
 
Philip Brickell, a forty-three-year-old employee of the London Under.pdf
Philip Brickell, a forty-three-year-old employee of the London Under.pdfPhilip Brickell, a forty-three-year-old employee of the London Under.pdf
Philip Brickell, a forty-three-year-old employee of the London Under.pdf
 
Periferik tolerans, bariyer bakl i�in neden kritiktir A) Uygun .pdf
Periferik tolerans, bariyer bakl i�in neden kritiktir A) Uygun .pdfPeriferik tolerans, bariyer bakl i�in neden kritiktir A) Uygun .pdf
Periferik tolerans, bariyer bakl i�in neden kritiktir A) Uygun .pdf
 
paypal i�in sorular Paypaln profili nedir Kullanm nasl.pdf
paypal i�in sorular Paypaln profili nedir Kullanm nasl.pdfpaypal i�in sorular Paypaln profili nedir Kullanm nasl.pdf
paypal i�in sorular Paypaln profili nedir Kullanm nasl.pdf
 
Paul Casey se retir� de la Marina de los EE. UU. en 2013. Recibe una.pdf
Paul Casey se retir� de la Marina de los EE. UU. en 2013. Recibe una.pdfPaul Casey se retir� de la Marina de los EE. UU. en 2013. Recibe una.pdf
Paul Casey se retir� de la Marina de los EE. UU. en 2013. Recibe una.pdf
 
Party Supply Inc. a calender year corporation, took a physical inven.pdf
Party Supply Inc. a calender year corporation, took a physical inven.pdfParty Supply Inc. a calender year corporation, took a physical inven.pdf
Party Supply Inc. a calender year corporation, took a physical inven.pdf
 
Parte 1 �Cu�l es el capital contable total de la Entidad A con bas.pdf
Parte 1 �Cu�l es el capital contable total de la Entidad A con bas.pdfParte 1 �Cu�l es el capital contable total de la Entidad A con bas.pdf
Parte 1 �Cu�l es el capital contable total de la Entidad A con bas.pdf
 
PART I Think about the best and worst companies you know. What is e.pdf
PART I Think about the best and worst companies you know. What is e.pdfPART I Think about the best and worst companies you know. What is e.pdf
PART I Think about the best and worst companies you know. What is e.pdf
 
Part AToday, theUS dollaris trading at 4.60, compared to 4.20 ayea.pdf
Part AToday, theUS dollaris trading at 4.60, compared to 4.20 ayea.pdfPart AToday, theUS dollaris trading at 4.60, compared to 4.20 ayea.pdf
Part AToday, theUS dollaris trading at 4.60, compared to 4.20 ayea.pdf
 
Parann d�ng�s� nedir Para d�ng�s�ne kimler katlyor Finansal bir il.pdf
Parann d�ng�s� nedir Para d�ng�s�ne kimler katlyor Finansal bir il.pdfParann d�ng�s� nedir Para d�ng�s�ne kimler katlyor Finansal bir il.pdf
Parann d�ng�s� nedir Para d�ng�s�ne kimler katlyor Finansal bir il.pdf
 

Recently uploaded

How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 

Recently uploaded (20)

How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 

Pleae help me with this C++ question, ill upvote thanks.Write the .pdf

  • 1. Pleae help me with this C++ question, ill upvote thanks. Write the definitions of the functions of the class orderedArrayListType that are not given in this chapter. please write a main.cpp and orderedArrayListTypeImp.cpp file and all the file that is given is everything i have for this task main.cpp #include #include "unorderedArrayListType.h" using namespace std; int main() { // Write your main here return 0; } //////////// orderedArrayListType.h #ifndef H_orderedArrayListType #define H_orderedArrayListType #include "arrayListType.h" class orderedArrayListType: public arrayListType { public: void insertAt(int location, int insertItem); void insertEnd(int insertItem); void replaceAt(int location, int repItem); int seqSearch(int searchItem) const; void insert(int insertItem); void remove(int removeItem); orderedArrayListType(int size = 100); //Constructor }; #endif ///////////////// orderedArrayListTypeImp.cpp /////////////////////////////
  • 2. arrayListType.h #include #include "orderedArrayListType.h" using namespace std; void orderedArrayListType::insert(int insertItem) { if (length == 0) //list is empty list[length++] = insertItem; //insert insertItem //and increment length else if (length == maxSize) cout << "Cannot insert in a full list." << endl; else { //Find the location in the list where to insert //insertItem. int loc; bool found = false; for (loc = 0; loc < length; loc++) { if (list[loc] >= insertItem) { found = true; break; } } for (int i = length; i > loc; i--) list[i] = list[i - 1]; //move the elements down list[loc] = insertItem; //insert insertItem length++; //increment the length } } //end insert int orderedArrayListType::seqSearch(int searchItem) const { int loc; bool found = false;
  • 3. for (loc = 0; loc < length; loc++) { if (list[loc] >= searchItem) { found = true; break; } } if (found) { if (list[loc] == searchItem) return loc; else return -1; } else return -1; } //end seqSearch void orderedArrayListType::insertAt(int location, int insertItem) { if (location < 0 || location >= maxSize) cout << "The position of the item to be " << "inserted is out of range." << endl ; else if (length == maxSize) //list is full cout << "Cannot insert in a full list." << endl; else { cout << "This is a sorted list. Inserting at the proper place." << endl; insert(insertItem); } } //end insertAt void orderedArrayListType::insertEnd(int insertItem) { if (length == maxSize) //the list is full
  • 4. cout << "Cannot insert in a full list." << endl; else { cout << "This is a sorted list. Inserting at the proper " << "place." << endl; insert(insertItem); } } //end insertEnd void orderedArrayListType::replaceAt(int location, int repItem) { if (location < 0 || location >= length) cout << "The location of the item to be replaced is out " << "of range." << endl; else { removeAt(location); insert(repItem); } } //end replaceAt void orderedArrayListType::remove(int removeItem) { int loc; if (length == 0) cout << "Cannot delete from an empty list." << endl; else { loc = seqSearch(removeItem); if (loc != -1) removeAt(loc); else cout << "The item to be deleted is not in the list." << endl; } } //end remove orderedArrayListType::orderedArrayListType(int size) : arrayListType(size) {
  • 5. } ///////////////// arrayListTypeImp.cpp #include #include "arrayListType.h" using namespace std; bool arrayListType::isEmpty() const { return (length == 0); } //end isEmpty bool arrayListType::isFull() const { return (length == maxSize); } //end isFull int arrayListType::listSize() const { return length; } //end listSize int arrayListType::maxListSize() const { return maxSize; } //end maxListSize void arrayListType::print() const { for (int i = 0; i < length; i++) cout << list[i] << " "; cout << endl; } //end print bool arrayListType::isItemAtEqual(int location, int item) const { if (location < 0 || location >= length) { cout << "The location of the item to be removed " << "is out of range." << endl; return false;
  • 6. } else return (list[location] == item); } //end isItemAtEqual void arrayListType::removeAt(int location) { if (location < 0 || location >= length) cout << "The location of the item to be removed " << "is out of range." << endl; else { for (int i = location; i < length - 1; i++) list[i] = list[i+1]; length--; } } //end removeAt void arrayListType::retrieveAt(int location, int& retItem) const { if (location < 0 || location >= length) cout << "The location of the item to be retrieved is " << "out of range" << endl; else retItem = list[location]; } //end retrieveAt void arrayListType::clearList() { length = 0; } //end clearList arrayListType::arrayListType(int size) { if (size <= 0) { cout << "The array size must be positive. Creating " << "an array of the size 100." << endl; maxSize = 100; }
  • 7. else maxSize = size; length = 0; list = new int[maxSize]; } //end constructor arrayListType::~arrayListType() { delete [] list; } //end destructor arrayListType::arrayListType(const arrayListType& otherList) { maxSize = otherList.maxSize; length = otherList.length; list = new int[maxSize]; //create the array for (int j = 0; j < length; j++) //copy otherList list [j] = otherList.list[j]; }//end copy constructor