Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for my java hw, I made a source code using Array. However when I run the program, I want it to display the areas where

for my java hw, I made a source code using Array. However when I run the program, I want it to display the areas where it is blank to be "0" instead in my rows and colums. here is my code:

public class ArrayTest { public static void printColumnHeading(int[][] arr, int maxColumnSize) { //then, print the column headings (based on the value of the longest row) for (int columnTemp = 0; columnTemp i) sum = sum + arr[i][column]; } System.out.printf("\t%.2f", sum/arr.length); } } public static float average (int [] arr) { float sum=arr[0]; for (int temp=1; temp arr[i]) minimum = arr[i]; } return minimum; } public static void main(String[] args) { int[][] b = {{1, 2}, {3, 4, 5}, {6, 7, 8, 9, 10}}; //a sample 2-dimensional array of int displayTable(b); //the method call }

} //end

image text in transcribed

here is the screenshot of my output. For the area in my rows which are blank, how do i make those into "zeroes". I want it to say:

1 2 0 0 0

3 4 5 0 0

6 7 8 9 10

thanks!

Start Page XInClass.java X ArrayTest.java X if (maximum arr [1]) minimum= arr [1]; return minimum; 68 69 70 71 72 73 74 75 76 public static void main (String [] args) i 2-dimensional array of int 7, 8, 9, 10}}; //a sample int [ ] [] b= {{1, 2), {3, 4, 5), {6, displayTable (b) //the method call Output InClass (run) X Avg 2.00 5.00 9.20 10 10 BUILD SUCCESSFUL (total time: 0 seconds)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Step: 3

blur-text-image

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

The organizations culture and politics

Answered: 1 week ago

Question

What is management growth? What are its factors

Answered: 1 week ago