
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write a method called largestRow that take a two-dimension array of integers as a parameter and returns the number of the row that has the largest length. For example, if the array (as created by the program below) is
10 45 3 8
2 42
3 21 44
The value returned would be zero (row zero has the largest length).
Expert Solution

arrow_forward
Introduction:
- Take two dimensional array of elements.
- And find the largest row of that given list of rows.
- Print that largest one.
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Similar questions
- In JAVAarrow_forwardWrite the output of the following statement : LINE 1 class Rectangle{ 2 int length,width,length1; 3 void insert(int l,int w){ 4 length=1; 5 width=w; 6 } 7 void insert(int 1){ 8 length1=1; 9 } 10 void display1() 11 { 12 System.out.println(width); 13 } 14 void display2() 15 { 16 System.out.println(length); 17 } 18 void calculateArea() 19 { 20 System.out.println(length*width); 21 22 } 23 void calculateArea3() 24 { 25 System.out.println(length1); 26 } 27 void calculateArea2() 28 { 29 System.out.println(length width 2); 30 } 31 } 32 class Test Rectangle2{ public static 33 void main(String args[]){ 34 Rectangle r1-new Rectangle(); 35 Rectangle r2-new Rectangle(); 36 Rectangle r3-new Rectangle(); 37 r1.insert(10,5); 38 r2.insert(3,5); 39 r3.insert(2); 40 r1.display1(); 41 r1.display2(); 42 r1.calculateArea(); 43 r2.calculateArea2(); 44 r2.display1(); 45 r2.display2(); 46 r2.calculateArea(); 47 r2.calculateArea2(); 48 r3.calculateArea3(); 49…arrow_forwardYou are given an array of n integers. Write a java method that splitsthe numbers of the array into two equal groups so that the GCD of all numbers in the second group is equal to one and the GCD of all numbers in the first group is not one. After splitting the numbers display the resulting groups as shown in the sample run below. Note: 1. The array has even size. 2. All elements of the array are less than 100. You are not allowed to define new arrays. 3. 4. You are not allowed to definenew methods or use methods from java libraries. Sample run of the method: Inputarray: (6,7,9,4,3,2} Output Group two: (7,9,3} Group one: (2,4,6} I Ignore Order of numbers. Order is not important //Ignore Order of numbers. Order is not importantarrow_forward
- 1. Write a program that calls a method that takes a character array as a parameter (you can initialize an array in the main method) and returns the number of vowels in the array. Partial program is given below. public class CountVowels{ public static void main(String[] args){ char[] arr= System.out.print("There are "+vowels(arr)+" vowels in the array");arrow_forwardThe programming language used is Javaarrow_forwardWrite a method that takes a rectangular two-dimensional array of type int. The method returns true if the sum of the even elements of the parameter array are larger than the sum of the odd elements, otherwise the method returns false. public static boolean sum(int[]0 in) Taken array Result 1 -3 17 5 -2 30 true 1 3 -1 -1 -3 -4 7 -1 10 false -1 3 -4 15arrow_forward
- In JAVA Write the method below: Given a two-dimensional array containing integers, create a method called "matrixOperations" The method should do the following:1. Print out all the numbers in the array row by row (add empty line at the end of the row)2. For each row, print out the length of the row (each row is an array, remember)arrow_forward2. Write a method that takes a rectangular two-dimensional array of type int and returns a valu of type int. The method returns the number of rows with negative sum. A row has a negative s if the sum of all its elements is less than 0. public static int countNegativeSum(int[][] in) Taken array Result 1 -3 17 -5 -5 14 -5 -2 30 -19 -8 -8 1 1 3 -1 -4 78 8 -3 -5 -1 -1 3 -4arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education