Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Mean,Median,Mode inquiry

843789Apr 22 2010 — edited Apr 24 2010
Curious as I have tried everything to get the random number generator to operate. Keep getting this error Basic_Stats.java:141: ';' expected
Math.random () "*" (99);
^
1 error

I have tried the code straight out of my java book as well for the random generator and many other variations don't get what the deal is. I have this same program I wrote in C++ thats works just fine and I was converting to a java version and all is well except this one error. Any suggestions would be appreciated.
public static void main(Strings[] args) 
	{
	   float workMean = 0;
	   int arraySize = 100;
	   int frequency = { 0 };
	   int response = new int[arraySize];
		 for (int i = 0; i<arraySize; i++)
                  {
		 if (response = 1) 
		 Math.random () "*" (99);
                   
		 System.out.print(response);
System.out.print("\n");
}


workMean = mean(response, arraySize);
median(response, arraySize);
mode(frequency, response, arraySize);


}
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 22 2010
Added on Apr 22 2010
19 comments
330 views