Emmma W.

asked • 07/06/21

Slove the task 03 in c++

dynarr.h

#ifndef DYNARR_H_INCLUDED

#define DYNARR_H_INCLUDED

class dynArr { private: int *data;

int size;

public:

dynArr();

dynArr(int);

~dynArr();

void setValue(int, int);

int getValue(int); };

#endif // DYNARR_H_INCLUDED

dynarr.cpp

#include "dynarr.h"

#include

#include using namespace std;

dynArr::dynArr() {

data = NULL;

size = 0; }

dynArr::dynArr(int s)

{ data = new int[s];

size = s; }

dynArr::~dynArr()

{ delete [] data;

}

int dynArr::getValue(int index)

{ return data[index];

}

void dynArr::setValue(int index, int value)

{

data[index] = value;

} ;

Tasks:

Task 3: Modify the header file and the source files again, so that it works for two dimensional array where all the rows are the same size. The user will specify the number of rows and columns as well as the content of the array, which you will take as input from user in the main function.

Patrick B.

header and C++ source code in your other postings. too big to fit here
Report

07/07/21

Patrick B.

or click on my picture to go to my profile and click the link for my email and send me an email. Your email gets all the source code because it is over 300+ lines long and too big to fit here. I am waiting for your email.
Report

07/07/21

1 Expert Answer

By:

Patrick B. answered • 07/07/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.