Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need an explanation of what this sample code is doing for this class i am supp

ID: 3862251 • Letter: I

Question

I need an explanation of what this sample code is doing for this class i am suppose to implement?

Sample P3main.cpp :
using namespace std;
#include
#include "zDepthList.cpp"
int main() {
int l[30];
for (int i=0;i<30;i++) l[i]=i;
zDepthList z(l,30);
z.out('f');
z.move(10,2,'f');
z.out();
z.move(14,3,'r');
z.out('r');
z.movefront(4);
z.moveback(13);
z.out();
cout << endl << endl;
for (int i=0;i<30;i+=2) l[i]=28-i;
zDepthList x(l,30);
x.out('f');
x.move(27,2,'f');
x.out();
x.move(3,8,'r');
x.out('r');
x.movefront(4);
x.moveback(13);
x.out();
x.addfront();
x.addback();
x.out();
#define bigsize 1000000
int big[bigsize];
for (int i=0;i zDepthList y(big,bigsize);
for (int i=0;i for (int i=0;i for (int i=1;i for (int i=0;i cout << y.at(6) << " " << y.at(bigsize-2) << endl;
}

Here is the output:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 0 1 2 3 4 5 6 7 8 9 11 12 10 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 13 10 12 14 11 9 8 7 6 5 4 3 2 1 0 4 0 1 2 3 5 6 7 8 9 11 14 12 10 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 13

28 1 26 3 24 5 22 7 20 9 18 11 16 13 14 15 12 17 10 19 8 21 6 23 4 25 2 27 0 29 28 1 26 3 24 5 22 7 20 9 18 11 16 13 14 15 12 17 10 19 8 21 6 23 4 25 2 0 29 27 27 29 0 2 25 4 23 6 21 8 19 10 17 12 15 14 13 16 11 18 9 20 7 22 5 24 26 1 28 3 4 3 28 1 26 24 5 22 7 20 9 18 11 16 14 15 12 17 10 19 8 21 6 23 25 2 0 29 27 13 30 4 3 28 1 26 24 5 22 7 20 9 18 11 16 14 15 12 17 10 19 8 21 6 23 25 2 0 29 27 13 31

999978 999994

Explanation / Answer

Hi,

As in the problem you have include the file zdepthlist.cpp file and after that you have used the properties and functions of that cpp file. Also, you have declared the functions with relative to the zDepthList class and after that it has consumed the functions of that zDepthClass in which you have passed the parameters to the functions accordingly.and after that you have displayed that output in the for loop which resulted in the given output.

I hope this will solve your problem.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote