Write a java program that asks the users to enter matrix

Assignment Help Computer Engineering
Reference no: EM132200921

Question :

Write a Java program that asks the users to enter a m × n matrix of integers, m and n being the number of rows and columns, respectively.

The program stores this matrix into a two-dimensional m × n array.

Then, write a class with the following three methods:

- Method 1 accepts the m × n array as its argument, performs its transpose, and returns the transposed n × m array;

- Method 2 accepts the jth column of the array as its argument, and returns the maximum of the column elements;

- Method 3 accepts the ith row of the array as its argument, and returns the average of the row elements.

Use this class in the main program to find the transpose, the maximum of column elements, and the average of row elements. The program should display all three results as shown below.

For example, if the user enters the following content:

20 -5 90 22 32

34 29 -3 44 2

100 0 92 37 0

The program should output:

The transpose is: 20 34 100

-5 29 0

90 -3 92

22 44 37

32 2 0

The maximum of all the column elements:

100 29 92 44 32

The average of all the row elements:

31.8

21.2

45.8

Reference no: EM132200921

Questions Cloud

Possible for an informative speech : Is it possible for an informative speech to be purely informative without being boring? What are some ways you can make your speech more engaging?
Creates an array of hundred double values : Creates an array of 100 double values. Using a loop, assigns a random value, between 0.0 and 1.0, to each element of the array.
Why is computer literacy important : Why is computer literacy important? How does this notion relate to the idea of a digital divide
Total sales for the year and the monthly average : Once all 12 months data is entered then loop through the array and calculated the total sales for the year and the monthly average for the year.
Write a java program that asks the users to enter matrix : Write a Java program that asks the users to enter a m × n matrix of integers, m and n being the number of rows and columns, respectively.
What are some details you should consider : When planning a presentation, what are some details you should consider? Give examples.
Write a java program to compute all prime numbers : Write a java program to compute all prime numbers less than equal to a given integer N.
List of properties and has to calculate the tax : Property on the list. You have been asked to design a program that the clerk can use to perform these calculations. In your interview with the tax clerk
Draw the budget set using given guidelines : Draw the budget set given that volunteers are only willing to perform the task they signed up for. (Remember free disposal.)

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain type of evidence first responders should be looking

Explain what sort of decontamination procedures and equipment will be necessary to treat victims. Identify the appropriate decontamination stage for the attack, and explain initial decontamination considerations. Explain the type of evidence first re..

  Using the euclidean algorithm find the decipherment key

Using the Euclidean Algorithm find the decipherment key, d, when p =53 and q=61 and the encryption exponent.

  Compare symbolic notation and numeric notation

Using symbolic notation, how would you set the permission of the group to be read and write, but no execute?

  Write matlab file that simulate operation of early late gate

[Clock Synchronization] A binary PAM communication systems uses a raised-cosine waveform with a rolloff factor of 0.4. The system transmission rate is 4800 bits

  Write an ascii character counter for an array in mips

The starting address of the array of ASCII characters must be passed to the subroutine in $a0.

  Express the concept and process of data binding

define the concept and process of Data Binding. Include an example of statements that would be used to create a Binding object. Explain the components and effects of your sample statement. Describe how to add, change, and delete records using boun..

  What would the mips assembly code

Assume that the variables f, g, h, i, j are assigned to registers $s0 through $s4. Assume that the base address of the A and B are in the registers $s6 and $s7. What would the MIPS assembly code be for the following C statements

  Question1 what are three goals of safety in computing for

question1. what are three goals of safety in computing? for each goal list two controls that be able to be implemented

  How mitigation strategies differ for web security threats

Understanding how cloud security differs from on-premise data center security is crucial for organizational success. What are three (3) key differences between.

  What fraction of the cpu is devoted to interrupt handling

Each packet is 48 bytes long, and thus fits into a cell. An interrupt takes 1 pee. What fraction of the CPU is devoted to interrupt handling?

  The perimeter method

The perimeter method is implemented in the superclass as it does not change based on the number of sides.

  What aspects of environment support structure of colleges

What aspects of environment support structure of colleges.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd