Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please check my code. Why am I getting RUN FAILED error from inputting 5 or 6? ========C++ CODE======== #include //I/O Library using namespace std; int

Please check my code. Why am I getting RUN FAILED error from inputting 5 or 6? image text in transcribed

========C++ CODE======== #include //I/O Library using namespace std;

int mrkRand(int=1

//Program Execution Begins Here int main(int argc, char** argv) { //Declare all Variables Here int *col; //Pointer to column array int *indx; //Index Array to the Sort Routine int **trangl; //Pointer to triangular array int rowSize; //Number of Rows in the Array //Input or initialize values Here cout>rowSize; indx=fillIdx(rowSize); //Index used for Database Sort col=fillAry(rowSize); //Dynamic 1-D array,#Columns in each row trangl=fillAry(col,rowSize);//Dynamic triangular array //Output Located Here cout

//Deallocate the array destroy(trangl,col,indx,rowSize); //Exit return 0; }

int **fillAry(int *col,int rows){ int **array=new int*[rows]; for(int i=0;i

void prntAry(int **array,int *col,int *indx,int rows){ for(int i=0;i

void mrkSort(int *array,int *indx,int size){ for(int pos=0;posarray[indx[lst]]){ indx[pos]=indx[pos]^indx[lst]; indx[lst]=indx[pos]^indx[lst]; indx[pos]=indx[pos]^indx[lst]; } } } }

void destroy(int **a,int *c,int *indx,int n){ //Delete every row of the triangular array for(int i=0;i

void prntAry(int *a,int n){ for(int i=0;i

int *fillAry(int n){ int *array=new int[n]; for(int i=0;i

int *fillIdx(int n){ int *array=new int[n]; for(int i=0;i

int mrkRand(int seed){ //Xn+1 = (aXn + c) mod m //where X is the sequence of pseudo-random values //m, 0 Input the Number of Rows in the Array 5 The Column Array Size 3 4 1 8 2 The Triangular Array Sorted 3 5 4 6 2 5 7 9 9 4 9 8 2 3 9 9 4 1 RUN FAILED (exit value 1, total time: 35)

<>

<>

<>

<>

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago