Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions