Question: Programming Assignment #5 (120 pts) Question I (30 pts): In this question, you are going to write methods that operate on matrices. The program reads

Programming Assignment \#5 (120 pts) Question I (30 pts): In this question, you are going to write methods that operate on matrices. The program reads values of matrices A,B, and C stored in a file called inputs.txt. This file should be placed under current directory where you have the program. The first line before each matrix contains the number of rows and the number of columns as shown below. in Hine. sp11t(' ' ')] for coluan in range(mubberofcolums): def printhatrix(aatrix) for now in range ( len ( ratrix) ) : for colum in range\{len\{zatrix[row ]} ): print (forat (eatrix [ row] [ coluen ], "5d"), end =+7 print() def fillatrintandonly(curberoflaos, nunberofcoluns ) : motrix - [] a Create an eopty lust for row in ranpe(nunberotkows): aatrix.appond\(1) Add an cepty nes roo for colunn in range\{murberof Colunns): aatr1x[row]-append[randos. randint \( \{0,593] \) return matr ix def generateZeraMatr 1x (nueheroflewh, nuatierof(nl uns ) : matrjx =[ [ a far i in range(numherdiknus) ] for j in range(numberof(coluens) ] reture wate 1x def addyatr 1(A,B)= C= generateZerohatr x(1sin[A],1enA[]]) for row in range(1en(A)): foe coluan fn range(1en {A[ row ]}) : fetura C [rio][colum] =A[ rowa ][ calian ]+B[row][ coluen ]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
