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

  Why should always add a destructor to linked data structure

Why should we always add a destructor to a linked data structure? How is a copy constructor used and why should a copy constructor be included.

  Describe which cloud architectures you would employ

Cloud Computing Assignment - Your team has been engaged to provide a risk assessment for MetaSoft in their planned move to a Hybrid Cloud strategy

  Write a program that reads in the average monthly rainfall

Write a program that reads in the average monthly rainfall for a city for each month of the year and then reads in the actual monthly rainfall.

  When you viewed the verbal and the nonverbal together

for this project use the concepts in units 5 and 6 and your own observations to identify the roles of verbal and

  Describe the program development cycle

Describe the importance of using a structured, modular approach when creating program requirements, design, and code.

  Write a program that prints the number of bytes used

Write a program that prints the number of bytes used to represent the char, int, short int, long int, float and double types on your computer.

  Write a script that takes a filename as argument

Write a script that takes a filename as argument and then compresses and decompresses the file with each of the programs compress, gzip, bzip2, and zip.

  Calculate the mean and standard deviation of the numbers

Using a C complier, obtain N floating point numbers from the user and calculate the mean and standard deviation of the numbers.

  Identify criteria that you would use to choose platforms

how you would choose between purchasing a desktop, laptop, notebook or mobile device. Identify criteria that you would use to choose one of these platforms

  Create a modular design diagram and proposal summary

To continue the network design to support the growth and expansion plan of West Consulting, you will create a modular design diagram and proposal summary.

  How to modify the product program to use a gui

create the product Program to use a GUI. The GUI should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory of that..

  What each person pays is for the bill and for the tip

Imagine that you and a number of friends go to a luxury restaurant, and when you ask for the bill. What each person pays is for the bill and for the tip?

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