this is all code of what u need to know about this is arraylistType.h // #include //Line
Question:
this is all code of what u need to know about
this is arraylistType.h //
#include //Line 1
#include //Line 2
#include
#include "arrayListType.h" //Line
using namespace std; //Line 4
int main() //Line 5
{
arrayListType L(7),L2(7);
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before differentiate(L) contains:" << endl;
L.print();
cout<<"differentiate(L) = "<< differentiate(L)<
cout << "List L after differentiate(L) contains:" << endl;
L.print();
cout<
L.clearList();
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before averageEach2(L) contains:" << endl;
L.print();
cout<<"calling averageEach2(L)"<
averageEach2(L);
cout << "List L after averageEach2(L) contains:" << endl;
L.print();
cout<
L.clearList();
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before keepPalindrome(L) contains:" << endl;
L.print();
cout<<"calling keepPalindrome(L)"<
keepPalindrome(L);
cout << "List L after keepPalindrome(L) contains:" << endl;
L.print();
cout<
arrayListType cL(8);//a,c,d,f,f,g,c,z
cL.insertEnd('a');
cL.insertEnd('c');
cL.insertEnd('d');
cL.insertEnd('f');
cL.insertEnd('f');
cL.insertEnd('g');
cL.insertEnd('c');
cL.insertEnd('z');
cout << "List cL before keepPalindrome(cL) contains:" << endl;
cL.print();
cout<<"calling keepPalindrome(cL)"<
keepPalindrome(cL);
cout << "List cL after keepPalindrome(cL) contains:" << endl;
cL.print();
cout<
L2.clearList();
cout << "List L before fill(L,"reverse", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"reverse", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"reverse", L2);"<
fill(L,"reverse", L2);
cout << "List L after fill(L,"reverse", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before fill(L,"reverse", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"reverse", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"reverse", L2);"<
fill(L,"reverse", L2);
cout << "List L after fill(L,"reverse", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before fill(L,"1half", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"1half", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"1half", L2);"<
fill(L,"1half", L2);
cout << "List L after fill(L,"1half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before fill(L,"1half", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"1half", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"1half", L2);"<
fill(L,"1half", L2);
cout << "List L after fill(L,"1half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before fill(L,"2half", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"2half", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"2half", L2);"<
fill(L,"2half", L2);
cout << "List L after fill(L,"2half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before fill(L,"2half", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"2half", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"2half", L2);"<
fill(L,"2half", L2);
cout << "List L after fill(L,"2half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before fill(L,"duplicate", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"duplicate", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"duplicate", L2);"<
fill(L,"duplicate", L2);
cout << "List L after fill(L,"duplicate", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before fill(L,"duplicate", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"duplicate", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"duplicate", L2);"<
fill(L,"duplicate", L2);
cout << "List L after fill(L,"duplicate", L2) contains:" << endl;
L.print();
cout<
return 0;
}
this member func//
#include //Line 1
#include //Line 2
#include
#include "arrayListType.h" //Line
using namespace std; //Line 4
int main() //Line 5
{
arrayListType L(7),L2(7);
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before differentiate(L) contains:" << endl;
L.print();
cout<<"differentiate(L) = "<< differentiate(L)<
cout << "List L after differentiate(L) contains:" << endl;
L.print();
cout<
L.clearList();
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before averageEach2(L) contains:" << endl;
L.print();
cout<<"calling averageEach2(L)"<
averageEach2(L);
cout << "List L after averageEach2(L) contains:" << endl;
L.print();
cout<
L.clearList();
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before keepPalindrome(L) contains:" << endl;
L.print();
cout<<"calling keepPalindrome(L)"<
keepPalindrome(L);
cout << "List L after keepPalindrome(L) contains:" << endl;
L.print();
cout<
arrayListType cL(8);//a,c,d,f,f,g,c,z
cL.insertEnd('a');
cL.insertEnd('c');
cL.insertEnd('d');
cL.insertEnd('f');
cL.insertEnd('f');
cL.insertEnd('g');
cL.insertEnd('c');
cL.insertEnd('z');
cout << "List cL before keepPalindrome(cL) contains:" << endl;
cL.print();
cout<<"calling keepPalindrome(cL)"<
keepPalindrome(cL);
cout << "List cL after keepPalindrome(cL) contains:" << endl;
cL.print();
cout<
L2.clearList();
cout << "List L before fill(L,"reverse", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"reverse", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"reverse", L2);"<
fill(L,"reverse", L2);
cout << "List L after fill(L,"reverse", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before fill(L,"reverse", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"reverse", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"reverse", L2);"<
fill(L,"reverse", L2);
cout << "List L after fill(L,"reverse", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before fill(L,"1half", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"1half", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"1half", L2);"<
fill(L,"1half", L2);
cout << "List L after fill(L,"1half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before fill(L,"1half", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"1half", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"1half", L2);"<
fill(L,"1half", L2);
cout << "List L after fill(L,"1half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before fill(L,"2half", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"2half", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"2half", L2);"<
fill(L,"2half", L2);
cout << "List L after fill(L,"2half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before fill(L,"2half", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"2half", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"2half", L2);"<
fill(L,"2half", L2);
cout << "List L after fill(L,"2half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before fill(L,"duplicate", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"duplicate", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"duplicate", L2);"<
fill(L,"duplicate", L2);
cout << "List L after fill(L,"duplicate", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before fill(L,"duplicate", L2) contains:" << endl;
L.print();
cout << "List L2 before fill(L,"duplicate", L2) contains:" << endl;
L2.print();
cout<<"calling fill(L,"duplicate", L2);"<
fill(L,"duplicate", L2);
cout << "List L after fill(L,"duplicate", L2) contains:" << endl;
L.print();
cout<
return 0;
}
//this nonmember func //
#include //Line 1
#include //Line 2
#include
#include "arrayListType.h" //Line
using namespace std; //Line 4
int main() //Line 5
{
arrayListType L(7),L2(7);
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before L.differentiate() contains:" << endl;
L.print();
cout<<"L.differentiate() = "<< L.differentiate()<
cout << "List L after L.differentiate() contains:" << endl;
L.print();
cout<
L.clearList();
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before L.averageEach2() contains:" << endl;
L.print();
cout<<"calling L.averageEach2()"<
L.averageEach2();
cout << "List L after L.averageEach2() contains:" << endl;
L.print();
cout<
L.clearList();
L.insertEnd(2);
L.insertEnd(1);
L.insertEnd(3);
L.insertEnd(4);
L.insertEnd(3);
L.insertEnd(3);
L.insertEnd(2);
cout << "List L before L.keepPalindrome() contains:" << endl;
L.print();
cout<<"calling L.keepPalindrome()"<
L.keepPalindrome();
cout << "List L after L.keepPalindrome() contains:" << endl;
L.print();
cout<
arrayListType cL(8);//a,c,d,f,f,g,c,z
cL.insertEnd('a');
cL.insertEnd('c');
cL.insertEnd('d');
cL.insertEnd('f');
cL.insertEnd('f');
cL.insertEnd('g');
cL.insertEnd('c');
cL.insertEnd('z');
cout << "List cL before cL.keepPalindrome() contains:" << endl;
cL.print();
cout<<"calling cL.keepPalindrome()"<
cL.keepPalindrome();
cout << "List cL after cL.keepPalindrome() contains:" << endl;
cL.print();
cout<
L2.clearList();
cout << "List L before L.fill("reverse", L2) contains:" << endl;
L.print();
cout << "List L2 before L.fill("reverse", L2) contains:" << endl;
L2.print();
cout<<"calling L.fill("reverse", L2);"<
L.fill("reverse", L2);
cout << "List L after L.fill("reverse", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before L.fill("reverse", L2) contains:" << endl;
L.print();
cout << "List L2 before L.fill("reverse", L2) contains:" << endl;
L2.print();
cout<<"calling L.fill("reverse", L2);"<
L.fill("reverse", L2);
cout << "List L after L.fill("reverse", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before L.fill("1half", L2) contains:" << endl;
L.print();
cout << "List L2 before L.fill("1half", L2) contains:" << endl;
L2.print();
cout<<"calling L.fill("1half", L2);"<
L.fill("1half", L2);
cout << "List L after L.fill("1half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before L.fill("1half", L2) contains:" << endl;
L.print();
cout << "List L2 before L.fill("1half", L2) contains:" << endl;
L2.print();
cout<<"calling L.fill("1half", L2);"<
L.fill("1half", L2);
cout << "List L after L.fill("1half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before L.fill("2half", L2) contains:" << endl;
L.print();
cout << "List L2 before L.fill("2half", L2) contains:" << endl;
L2.print();
cout<<"calling L.fill("2half", L2);"<
L.fill("2half", L2);
cout << "List L after L.fill("2half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before L.fill("2half", L2) contains:" << endl;
L.print();
cout << "List L2 before L.fill("2half", L2) contains:" << endl;
L2.print();
cout<<"calling L.fill("2half", L2);"<
L.fill("2half", L2);
cout << "List L after L.fill("2half", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
cout << "List L before L.fill("duplicate", L2) contains:" << endl;
L.print();
cout << "List L2 before L.fill("duplicate", L2) contains:" << endl;
L2.print();
cout<<"calling L.fill("duplicate", L2);"<
L.fill("duplicate", L2);
cout << "List L after L.fill("duplicate", L2) contains:" << endl;
L.print();
cout<
L2.clearList();
L2.insertEnd(2);
L2.insertEnd(1);
L2.insertEnd(3);
L2.insertEnd(4);
L2.insertEnd(3);
L2.insertEnd(3);
L2.insertEnd(2);
cout << "List L before L.fill("duplicate", L2) contains:" << endl;
L.print();
cout << "List L2 before L.fill("duplicate", L2) contains:" << endl;
L2.print();
cout<<"calling L.fill("duplicate", L2);"<
L.fill("duplicate", L2);
cout << "List L after L.fill("duplicate", L2) contains:" << endl;
L.print();
cout<
return 0;
}
International Management Culture, Strategy, and Behavior
ISBN: 978-0077862442
9th edition
Authors: Fred Luthans, Jonathan Doh