Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the code below, Modify the Static Arrays to Dynamic. Replace all instances of array notation with pointer notation. #include //Input - Output Library #include

Using the code below,

Modify the Static Arrays to Dynamic.

Replace all instances of array notation with pointer notation.

#include //Input - Output Library
#include //Random number function
#include //Time to set the seed
using namespace std; //Name-space under which system libraries exist
//User Libraries
//Global Constants
//Function Prototypes
void filAray(int [],int);
void prntAry(int [],int,int);
void mrkSort(int [],int);
//Execution begins here
int main(int argc, char** argv) {
//Set the random number seed
srand(static_cast(time(0)));
//Declare variables
const int SIZE=100;
int array[SIZE]={};
//Input data
filAray(array,SIZE);
prntAry(array,SIZE,10);
//Map inputs to outputs or process the data
mrkSort(array,SIZE);
//Output the transformed data
prntAry(array,SIZE,10);
//Exit stage right!
return 0;
}
void mrkSort(int a[],int n){
for(int pos=0;pos
for(int indx=pos+1;indx
if(a[pos]>a[indx]){
int temp=a[pos];
a[pos]=a[indx];
a[indx]=temp;
}
}
}
}
void prntAry(int a[],int n,int perLine){
cout<
for(int indx=0;indx
cout<
if(indx%perLine==(perLine-1))cout<
}
cout<
}
void filAray(int a[],int n){
for(int indx=0;indx
a[indx]=rand()%90+10;//Fill with 2 digit number
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Big Data Interview 751 Comprehensive Questions And Expert Answers

Authors: Mr Bhanu Pratap Mahato

1st Edition

B0CLNT3NVD, 979-8865047216

More Books

Students also viewed these Databases questions

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago