Question: not use built-in sort and methods/functions not covered in class Problem 3 : [ 10 marks] Classname : Problem 3 _studentid Write a java program

not use built-in sort and methods/functions not covered in class

Problem 3: [10 marks]

Classname: Problem3_studentid

Write a java program that prompts the user to enter the length of a square matrix, randomly fills in As and Zs into the matrix, prints the matrix, and finds the rows, columns, and diagonals with all As or Zs.

You must implement 1 method for each of the following tasks:

a. Creating a square matrix and randomly fills in As and Zs into the matrix.
b. Prints the context of the matrix
c. Finding the rows, columns, and diagonals with all As or Zs

Note:

1. Do not create global variables (-50%)
2. matrix is a string
3. There is no array requirement

Enter the size for the matrix: 4

AZZZ

AAAA

AZAA

ZZZZ

All As on row 2

All Zs on row 4

No same letters on a column

No same letters on a diagonal

Able to get user input of type int : 1 mark

Able to fill As and Zs correctly: 2 marks

Finding As and Zs on rows w/ output : 2 marks

Finding As and Zs on columns w/ output: 2 marks

Finding As and Zs on diagonal w/ output: 3 marks

*output means display an appropriate message (See sample display above when As and Zs are found or not found)

Do not use methods/functions not covered in our class

Thinking of 2-dimensional array? Dont use it. You dont need it. not use built-in sort and methods/functions not covered in class

Problem 3: [10 marks]

Classname: Problem3_studentid

Write a program that prompts the user to enter the length of a square matrix, randomly fills in As and Zs into the matrix, prints the matrix, and finds the rows, columns, and diagonals with all As or Zs.

You must implement 1 method for each of the following tasks:

a. Creating a square matrix and randomly fills in As and Zs into the matrix.
b. Prints the context of the matrix
c. Finding the rows, columns, and diagonals with all As or Zs

Note:

1. Do not create global variables (-50%)
2. matrix is a string
3. There is no array requirement

Enter the size for the matrix: 4

AZZZ

AAAA

AZAA

ZZZZ

All As on row 2

All Zs on row 4

No same letters on a column

No same letters on a diagonal

Able to get user input of type int : 1 mark

Able to fill As and Zs correctly: 2 marks

Finding As and Zs on rows w/ output : 2 marks

Finding As and Zs on columns w/ output: 2 marks

Finding As and Zs on diagonal w/ output: 3 marks

*output means display an appropriate message (See sample display above when As and Zs are found or not found)

Do not use methods/functions not covered in our class

Thinking of 2-dimensional array? Dont use it. You dont need it.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!