Results 1 to 4 of 4
  1. #1
    Limens is offline Member
    Join Date
    Feb 2012
    Posts
    1
    Rep Power
    0

    Default new to java, school assignment

    Write code for the method double avarage (double g[]) in a class by the name EarthAcceleration so the mean of gValues[] = {9.80, 9.85, 9.82, 9.86, 9.78} calculates.

    This is what's given to me already, but how do I proceed ;/?

    Java Code:
    public class EarthAcceleration
    {
       public EarthAcceleration()
       {
       }
    
       public double average(double g[])
       {
       }
    
    }
    note that I'm working in BlueJ
    Last edited by Limens; 02-22-2012 at 02:57 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: new to java, school assignment

    How would you find the average without a computer? Express that systematically and convert it into code.

    If you haven't a clue about Java coding, start here: Trail: Learning the Java Language (The Java™ Tutorials)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Army is offline Senior Member
    Join Date
    Jan 2012
    Posts
    147
    Rep Power
    0

    Default Re: new to java, school assignment

    You have to make the array first, before you even want to think about getting the mean for the array.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: new to java, school assignment

    Quote Originally Posted by Army View Post
    You have to make the array first, before you even want to think about getting the mean for the array.
    Quote Originally Posted by Limens View Post
    ... gValues[] = {9.80, 9.85, 9.82, 9.86, 9.78} ...
    Sure looks like an array assignment to me.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. I need help with my school assignment, please
    By burnenator in forum New To Java
    Replies: 13
    Last Post: 11-21-2011, 04:54 AM
  2. Need help with school assignment
    By sljkbn in forum New To Java
    Replies: 6
    Last Post: 10-28-2009, 01:07 PM
  3. Help with noob school assignment
    By debo3381 in forum New To Java
    Replies: 3
    Last Post: 09-23-2009, 04:02 AM
  4. Question about school assignment
    By wata in forum New To Java
    Replies: 7
    Last Post: 08-18-2009, 02:00 PM
  5. Please help... assignment for school
    By confused2000 in forum New To Java
    Replies: 3
    Last Post: 11-12-2007, 08:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •