close-red

CS605 - Software EngineeringII

Question(s) similar to the following:

Read the given below code and explain what task is being performed by this function
Matrix :: Matrix ( int row , int col ) {
numRows = row ;
numCols = col ;
elements = new ( double * ) [ numRows ] ;
for ( int i = 0 ; i < numRows ; i ++ ) {
elements [ i ] = new double [ numCols ] ;
for ( int j = 0 ; j < numCols ; j ++ )
elements [ i ] [ j ] = 0.0 ;
}
}
Hint : This function belong to a matrix class, having
Number of Rows = numRows
Number of Columns = numCols

Question 1: Read the given below code and explain what task is being performed by this function
Matrix :: Matrix ( int row , int col ) {
numRows = row ;
numCols = col ;
elements = new ( double * ) [ numRows ] ;
for ( int i = 0 ; i < numRows ; i ++ ) {
elements [ i ] = new double [ numCols ] ;
for ( int j = 0 ; j < numCols ; j ++ )
elements [ i ] [ j ] = 0.0 ;
}
}
Hint : This function belong to a matrix class, having
Number of Rows = numRows
Number of Columns = numCols

Answer: Suggest Edit

In the above mentioned code, first of all programmer call the constructor who have two parameters for the number of rows & columns in the matrix. Then this constructor also dynamically allocates the memory for the elements of the matrix & also initializes the value of the all elements of matrix with 0.0

Similar Questions:

Question 2: Read the given below code and explain what task is being performed by this function
Matrix :: Matrix ( int row , int col ) {
numRows = row ;
numCols = col ;
elements = new ( double * ) [ numRows ] ;
for ( int i = 0 ; i < numRows ; i ++ ) {
elements [ i ] = new double [ numCols ] ;
for ( int j = 0 ; j < numCols ; j ++ )
elements [ i ] [ j ] = 0.0 ;
}
}
Hint : This function belong to a matrix class, having
Number of Rows = numRows
Number of Columns = numCols

Answer: Suggest Edit

In the above mentioned code, first of all programmer call the constructor who have two parameters for the number of rows & columns in the matrix. Then this constructor also dynamically allocates the memory for the elements of the matrix & also initializes the value of the all elements of matrix with 0.0
Past Papers of CS605 - Software EngineeringII
Sponsored

Attach VULMS for better learning experience!
Attach VULMS Account

Our VULMS adds features of MDBs and lets your populate VU subjects automatically.

Tajweed Classes (Learn Quran with Tajweed)
Learn Holy Quran with Tajweed

Try our 3 days free demo now! Online online holy quran tajweed classes are useful to learn reading holy quran with tajweed.

Gegasoft POS/CRM Software
Gegasoft Point of Sale/Customer Relationship Managemnet Software

Gegasoft Point of Sale/Customer Relationship Management software is an accounting software to fulfill your business needs.

Sponsored

?