Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Write a Java Program for the following steps(one-by-one) (15 Points): a) The program asks the user to provide the number of rows and

1) Write a Java Program for the following steps(one-by-one) (15 Points): a) The program asks the user to

1) Write a Java Program for the following steps(one-by-one) (15 Points): a) The program asks the user to provide the number of rows and columns. (2 Points) b) The program should create a 2D array based on the user given size. (2 Points) c) The program should store random values in range from 55 to 550 within the 2D array and print it. (2 Points) d) The program should then call a method called "findAverage" and pass this 2D array as a parameter to this method. (2 Points) e) Inside the method "findAverage", the program should ask the user to enter a row number of his/her choice. (i.e., if there are 4 rows, then the user should provide a number in range of 0 to 3). (2 Points) f) The method should print the average of values present only in the user given row number. (4 points) g) Inside the main method, the program should call another method called "getArray" and pass the 2D array (from step (c)) as its parameter. (2 Points) h) Inside the "getArray" method, the program should multiply only the odd values present within the 2D array by 2. (5 Points) i) The program should then return the resulting 2D array back to the main method. (2 Points) j) The main method should print the returned 2D array. (2 Points) CPS 2231 Computer Programming Homework Assignment 2 2) Write a Java Program for the following steps(one-by-one) (15 Points): Write a Java program that prompts the user to enter the dimensions (number of rows and columns) of a 2D array, creates the array, and populates it with random integer values in the range of 100 to 500. Then, your program should sort the values in each column of the matrix in ascending order and print the sorted matrix.

Step by Step Solution

3.47 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

Alright lets tackle the first set of tasks for the Java program java import javautilScanner import j... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions