Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Double array averages

  1. #1
    Member Scorks's Avatar
    Join Date
    Jan 2013
    Posts
    56
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Double array averages

    Hi! I'm trying to make a java method that takes a double array (3x3) and finds the average of the numbers around each value in the array then prints it out. I have no idea what kind of method I should use to do this. So far, I have
    public class A4Q3 {
     
    public static void main(String[] args) {
     
    int row = 3;
    int column = 3;
    int[][] values = new int[row][column];
     
    int[][] values =
    {
{ 1, 2, 3, },
    { 4, 5, 6, },
    { 7, 8, 9, }
    };
     
    public static double neighborAverage(int[][] values, int row, int column) {

    But now I'm completely stuck. Any help is greatly appreciated!

    Thanks
    Scorks


  2. #2
    Member
    Join Date
    Feb 2013
    Posts
    45
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default Re: Double array averages

    i think you want to calculate the average 2d array..

    if you want this refer this link:

    finding average in 2d arrays

    Otherwise you post your code completely and explain your doubt clearly....
    Regards
    Android developer
    Trinay Technology Solutions
    http://www.trinaytech.com
    5705750475

  3. #3
    Member angstrem's Avatar
    Join Date
    Mar 2013
    Location
    Ukraine
    Posts
    200
    My Mood
    Happy
    Thanks
    9
    Thanked 31 Times in 29 Posts

    Default Re: Double array averages

    Yeah, explain please better your intent. Also, if possible, give an example of an input to method and the desired output with explanations of how did you get it.

Similar Threads

  1. trouble with making a simple construct for an array of double type
    By Abadude in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 29th, 2012, 05:05 PM
  2. Help with double array method
    By Dsr122076 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: November 21st, 2012, 04:34 PM
  3. Help with arrays. Computing averages, sorting the array,
    By ribb3ntrop in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 15th, 2012, 10:39 AM
  4. How can I store a double array in mysql
    By luck999 in forum JDBC & Databases
    Replies: 1
    Last Post: March 15th, 2012, 05:42 AM
  5. Elements in double array (java)
    By wrx12 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: March 9th, 2012, 11:23 PM

Tags for this Thread