Results 1 to 7 of 7
Thread: Help . I am having problems
 09262012, 12:24 PM #1Member
 Join Date
 Sep 2012
 Location
 Utah
 Posts
 7
 Rep Power
 0
Help . I am having problems
There are 7 errors in this program that I am unable to locate due to inexperience. Please locate and tell me of all 7 errors. Include what the errors are and how to fix them .
// A class that computes the sample statistics of the ages of
// family members.
public class FamilyStats
{
public static void main(String[] args)
{
/*
math equations obtained from: */
Sample Variance  from Wolfram MathWorld
// define some ages
int momsAge= 42; dadsAge= 43;
int myAge= 22, sistersAge= 16;
int dogsAge= 6;
// get the mean
double ageSum = (momsAge + dadsAge + myAge + sistersAge + DogsAge);
double average = ageSum / 5
/ calculate the sample variance
double variance= 0.0;
variance += (momsAge  average)*(momsAge  average);
variance += (dadsAge  average)(dadsAge  average);
variance += (myAge  average)*(myAge  average);
variance += (sistersAge  average)*(sistersAge  average);
variance += (dogsAge  average)*(dogsAge  average);
variance = variance / 4;
// get the std. dev
double standardDev= Math.sqrt(variance);
// output the results
System.out.println(The sample age mean is: + average);
System.out.println("The sample age variance is: " + variance);
System.out.println("The sample age standard deviation is: " + standardDev);
}
 09262012, 12:47 PM #2Moderator
 Join Date
 Apr 2009
 Posts
 13,541
 Rep Power
 26
Re: Help . I am having problems
Please use [code] tags [/code] when posting code.
A lot of people here won't bother reading unformatted code.
You also need to post the errors you are getting and what line(s) they are occurring on.
AGain, most people here will not copy/paste code into an IDE to find out where your code is not compiling.Please do not ask for code as refusal often offends.
** This space for rent **
 09262012, 06:22 PM #3Member
 Join Date
 Sep 2012
 Location
 Utah
 Posts
 7
 Rep Power
 0
Re: Help . I am having problems
what do u mean by
Java Code:tags
 09262012, 06:38 PM #4Moderator
 Join Date
 Apr 2009
 Posts
 13,541
 Rep Power
 26
Re: Help . I am having problems
Exactly what I said.
Look at your second post.
If your code in your original post were wrapped in tags like that then it would retain its formatting.Please do not ask for code as refusal often offends.
** This space for rent **
 09262012, 07:16 PM #5
Re: Help . I am having problems
I posted every single mistake and I have a feeling that I have done your homework. So I deleted them.
I think those were all syntax errors.
To fix them all read through these : http://docs.oracle.com/javase/tutorial/
By the end you will most probably know what's wrong with the code.Last edited by PhQ; 09262012 at 07:27 PM.
 09262012, 08:35 PM #6
Re: Help . I am having problems
Please go through the Forum Rules  particularly the third paragraph.
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
 09262012, 09:02 PM #7Member
 Join Date
 Jan 2012
 Posts
 49
 Rep Power
 0
Similar Threads

InputStream/Jar Problems/File IO Problems
By rdjava in forum Advanced JavaReplies: 31Last Post: 01172011, 12:12 PM 
JAR problems
By Evil Smurf in forum New To JavaReplies: 4Last Post: 09012009, 02:17 AM 
Few Problems Help!
By elad_bj in forum New To JavaReplies: 4Last Post: 04072009, 04:45 AM 
Problems in JSP : Need help
By raj4u in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 02072008, 11:06 AM 
gui problems
By bluebirdjc in forum Advanced JavaReplies: 2Last Post: 07232007, 06:38 PM
Bookmarks