SlideShare a Scribd company logo
1 of 7
Download to read offline
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 .pdfalmonardfans
 
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 .pdfarshin9
 
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.pdfmallik3000
 
#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.pdfangelsfashion1
 
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.pdfanwarsadath111
 
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.pdfrajkumarm401
 
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.pdfConint29
 
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.docxDIPESH30
 
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.pdfjeetumordhani
 
#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.docxgertrudebellgrove
 
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.pdfabiwarmaa
 
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).pdfafgt2012
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfravikapoorindia
 
#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.docxajoy21
 
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docx
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docxRightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docx
RightTrianglerightTriangle.cppRightTrianglerightTriangle.cpp.docxjoellemurphey
 
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. .pdfamarndsons
 

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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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 .pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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 .pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 
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.pdfvinodagrawal6699
 

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

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Recently uploaded (20)

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

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