enter the size of the array... 10100 11011 00101 11100 00101 fraction of ones = 13/25 fraction of zeros = 12/25 row 0 sum = 2 row 1 sum = 4 row 2 sum = 2 row 3 sum = 3 row 4 sum = 2 row 1 has the largest row sum! col 0 sum = 3 col 1 sum = 2 col 2 sum = 4 col 3 sum = 1 col 4 sum = 3 col 2 has the largest col sum! columns win! diagonal sum is 4 diagonals rule

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

How to write a program in java that ask the user to input an int size value into a 2d array, then output a table of random 0 and 1 of that size (table must be a perfect square), then output the fraction of your array that is ones and the fraction that is zeros, then output the sum for each row, the sum of colunms and which row and colunm have the largest sum, then determine if the largest row sum is greater than the largest column sum or vice versa, then output the sum of the diagonal(the diagonal starting at location [0][0] and going down to [N-1][N-1] for an array of size N) and determine if the diagonal sum is greater or equal to the largest row sum and greater than or equal to the largest column sum?

output should look similar to screen shot

 

enter the size of the array...
10100
11011
00101
11100
00101
fraction of ones =
13/25
fraction of zeros = 12/25
row 0 sum = 2
row 1 sum = 4
row 2 sum = 2
row 3 sum = 3
row 4 sum = 2
row 1 has the largest row sum!
col 0 sum = 3
col 1 sum
= 2
col 2 sum = 4
col 3 sum = 1
col 4 sum = 3
col 2 has the largest col sum!
columns win!
diagonal sum is 4
diagonals rule
Transcribed Image Text:enter the size of the array... 10100 11011 00101 11100 00101 fraction of ones = 13/25 fraction of zeros = 12/25 row 0 sum = 2 row 1 sum = 4 row 2 sum = 2 row 3 sum = 3 row 4 sum = 2 row 1 has the largest row sum! col 0 sum = 3 col 1 sum = 2 col 2 sum = 4 col 3 sum = 1 col 4 sum = 3 col 2 has the largest col sum! columns win! diagonal sum is 4 diagonals rule
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 4 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education