ScholarMatic | 24/7 Homework Help

ScholarMatic Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

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,

by | Nov 28, 2023 | programming

ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

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:

ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

ScholarMatic: Get Started

Assignment Writing Service

Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!