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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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