Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Project 1: Pattern Printing Write a MIPS program to print out a matrix of patter

ID: 668156 • Letter: P

Question

Project 1: Pattern Printing

Write a MIPS program to print out a matrix of pattern, based on the user’s input n.

a

b

c

d

e

f

g

b

c

d

*

f

g

a

c

d

*

*

*

a

b

d

*

*

*

*

*

c

e

f

*

*

*

c

d

f

g

a

*

c

d

e

g

a

b

c

d

e

f

Full grade (100/100):

Take a number n from the user (assuming the user always inputs an odd number for n), print out a matrix, but with a “diamond of *” in the middle of it.

I/O demonstrations (10%):

Include 5 screenshots on the running I/O of your program to show the behavior of your program. Be creative and thorough to cover all the representative cases

Implementation details For Level 1: (20%)

Describe your looping structure to print the matrix

How do you calculate which character print for a specific location - say (row 3, column 4), and (row 3, column 5)?

1. How did you decide how many, and where to put the *’s, for each row?

Additional notes

If you have implemented any additional features, provide a clear list with descriptions.

a

b

c

d

e

f

g

b

c

d

*

f

g

a

c

d

*

*

*

a

b

d

*

*

*

*

*

c

e

f

*

*

*

c

d

f

g

a

*

c

d

e

g

a

b

c

d

e

f

Explanation / Answer

In this MIPS Table

Program:

C Program Calculate Sum of each Row and each Col of a Matrix

by Dinesh Thakur

This is C Program to calculate the sum of the elements of each row & column. A matrix is made of rows and columns. The program will add all the rows and the columns of the matrix.

In this program a composed matrix will be used to add the rows and columns. The required variables are also declared that are contain the value. Array type variables also use for the loop statement. In this program nested for loop used to computing the sum for rows and columns of a composed matrix. First loop will be add to make matrix the other one will be the computing the rows addition and the next will be do the same for columns. In the last instance the result will be displayed on the screen.
Problem Statement :
This program will evaluate the sum of each row and column from composed matrix.

Here is source code of the C program to compute the rows and columns of composed matrix. The C program is successfully compiled. The program output is also shown below.

a b c d e f g b c d e f g a c d e f g a b d e f g a b c e f g a b c d f g a b c d e g a b c d e f