4. Create following functions, and test use given main function. int** create2DArray(int row, int column): return a 2d dynamic int array with given row and column. void populate(int** array, int row,

We're the ideal place for homework help. If you are looking for affordable, custom-written, high-quality and non-plagiarized papers, your student life just became easier with us. Click either of the buttons below to place your order.


Order a Similar Paper Order a Different Paper

4. Create following functions, and test use given main function.

int** create2DArray(int row, int column): return a 2d dynamic int array with given row

and column.

void populate(int** array, int row, int column, int start): initialize the given dynamic

2d array use number from start, and increase one every element.

void print(int** array, int row, int column): print every element from given dynamic 2d

array.

void delete2DArray(int** array, int row, int column): which delete given dynamic 2d

array from the heap.

Use pointer arithmetic for every function.

Use following main() to test your class.

int main(){

int **a = create2DArray(3,5);

populate(a,3,5,10);

print(a,3,5);

delete2DArray(a,3,5);

cout<<endl;

a = create2DArray(2,6);

populate(a,2,6,22);

print(a,2,6);

delete2DArray(a,2,6);

}

Output from given main function:

10 11 12 13 14

15 16 17 18 19

20 21 22 23 24

22 23 24 25 26 27

28 29 30 31 32 33

5. Q5: Write a function for given main function

void bargraph(int n)

which takes an integer n and print the bar graph based on the digit of given integer.

Use pointer arithmetic and Dynamic Array if you would like to use array.

Use following main() to test your class.

int main(){

bargraph(12945);

bargraph(6789102);

}

Output from given main function:

X

X

X

X

X X

X X X

X X X

X X X X

X X X X X

———-

1 2 9 4 5

X

X X

X X X

X X X X

X X X X

X X X X

X X X X

X X X X X

X X X X X X

————–

6 7 8 9 1 0 2

Answer:

Writerbay.net

Do you need academic writing help? Our quality writers are here 24/7, every day of the year, ready to support you! Instantly chat with a customer support representative in the chat on the bottom right corner, send us a WhatsApp message or click either of the buttons below to submit your paper instructions to the writing team.


Order a Similar Paper Order a Different Paper
Writerbay.net