Question: Draw flowgraphs and calculate the cyclomatic complexity, v(G) , essential complexity, ev(G) , module design complexity, iv(G) , system design complexity, S 0 , and
Draw flowgraphs and calculate the cyclomatic complexity, v(G), essential complexity, ev(G), module design complexity, iv(G), system design complexity, S0, and integration complexity, S1 for the software code below.
| LABELS | PROGRAM LISTING | |
|
| PROGRAM matsub | |
|
| c | Product of two matrices |
|
|
| dimension a(10,10),b(10,10),c(10,10) |
|
|
| integer p,q |
|
|
| write(*,*)'To find the product of two matrices.' |
|
|
| write(*,*)'Enter the order of the first matrix:' |
|
|
| read(*,*)m,n |
|
|
| write(*,*)'Enter the order of the second matrix:' |
|
|
| read(*,*)p,q |
|
|
| IF(n.NE.p)THEN |
|
|
| write(*,*)'The matrices are not conformable for multiplication.' |
|
|
| STOP |
|
|
| ENDIF |
|
|
| call inpt(a,m,n) |
|
|
| call inpt(b,p,q) |
|
|
| call pro(a,b,c,m,n,q) |
|
|
| call outpt(c,m,q) |
|
|
| STOP |
|
|
| END |
|
|
| subroutine inpt(a,m,n) |
|
|
| dimension a(10,10) |
|
|
| write(*,10)m,n |
|
| 10 | format(1x,'Enter the matrix of order',I2,' *'I2,' :') |
|
|
| read(*,*)((a(i,j),j=1,n),i=1,m) |
|
|
| END |
|
|
| subroutine pro(a,b,c,m,n,q) |
|
|
| dimension a(10,10),b(10,10),c(10,10) |
|
|
| integer q |
|
|
| DO 20 i=1,m |
|
|
| DO 30 j=1,q |
|
|
| c(i,j)=0 |
|
|
| DO 40 k=1,n |
|
|
| c(i,j)=c(i,j)+a(i,k)*b(k,j) |
|
|
| read(*,*)((a(i,j),j=1,n),i=1,m) |
|
| 40 | continue |
|
| 30 | continue |
|
| 20 | continue |
|
|
| END |
|
|
| subroutine outpt(c,m,q) |
|
|
| dimension c(10,10) |
|
|
| integer q |
|
|
| write(*,*)'The product matrix is: ' |
|
|
| DO 50 i=1,m |
|
|
| DO 60 j=1,q |
|
|
| write(*,70)c(i,j) |
|
| 70 | format(3x,F6.2,4x\) |
|
| 60 | continue |
|
|
| write(*,*) |
|
| 50 | continue |
|
|
| END |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
