Um, just so you know, you can keep using the same Scanner object.
Offline
If not x==max and not x==mid then x=middle
-ish?
Offline
Just a note that the posts from matthew8092001's post to here were originally from another topic that I merged with this one. Sorry for any possible confusion!
Offline
nvm, I've got it.
By the way, how do you calculate the mode?
I've already got the mean and median.
import java.util.Scanner; import java.lang.Object; //Why did I import this again? import java.util.Arrays; public class arrayMean { public static void main (String[]args){ System.out.println("Please enter a:"); Scanner avalue = new Scanner (System.in); int a = avalue.nextInt(); System.out.println("Please enter b:"); Scanner bvalue = new Scanner (System.in); int b = bvalue.nextInt(); System.out.println("Please enter c:"); Scanner cvalue = new Scanner (System.in); int c = cvalue.nextInt(); System.out.println("Please enter d:"); Scanner dvalue = new Scanner (System.in); int d = dvalue.nextInt(); System.out.println("Please enter e:"); Scanner evalue = new Scanner (System.in); int e = evalue.nextInt(); int nums[]={a, b, c, d, e}; double result= 0; int i=0; for(i=0; i < nums.length; i++){ result=result + nums[i]; } System.out.println("Average is " + result/nums.length); Arrays.sort(nums); System.out.println("Median is "+ nums[2]); } }
Offline
Making my first game in Java. :DDD
Offline
poopo wrote:
ProgrammingFreak wrote:
Making my first game in Java. :DDD
Are you using lwjgl?
Yes, I will be.
Well, I hope so.
Last edited by ProgrammingFreak (2012-04-11 16:14:59)
Offline
Lol thanks for bringing this back up.
I am also working on my new game Dominia. It's using LWJGL also, and graphics made in Photoshop CS6 (although that makes no difference if I still suck at it)
Good luck!
Anyway, as I said before I want to try to make some money from it ($5 per sale) but will give away plenty to scratchers to "get the word out"
Offline
16Skittles wrote:
Lol thanks for bringing this back up.
I am also working on my new game Dominia. It's using LWJGL also, and graphics made in Photoshop CS6 (although that makes no difference if I still suck at it)
Good luck!
Anyway, as I said before I want to try to make some money from it ($5 per sale) but will give away plenty to scratchers to "get the word out"
Okay, nice.
Offline
16Skittles wrote:
Lol thanks for bringing this back up.
I am also working on my new game Dominia. It's using LWJGL also, and graphics made in Photoshop CS6 (although that makes no difference if I still suck at it)
Good luck!
Anyway, as I said before I want to try to make some money from it ($5 per sale) but will give away plenty to scratchers to "get the word out"
Cool!
wiki wrote:
Dominia is a Russian melodic death metal band formed in Saint Petersburg in 1999.
XD
Last edited by poopo (2012-04-11 16:51:01)
Offline
poopo wrote:
16Skittles wrote:
Lol thanks for bringing this back up.
I am also working on my new game Dominia. It's using LWJGL also, and graphics made in Photoshop CS6 (although that makes no difference if I still suck at it)
Good luck!
Anyway, as I said before I want to try to make some money from it ($5 per sale) but will give away plenty to scratchers to "get the word out"Cool!
wiki wrote:
Dominia is a Russian melodic death metal band formed in Saint Petersburg in 1999.
XD
Really? xD
Well, I was looking for synonyms for town/village and got Dominion, and personally I like names that sound like French or Spanish so I added the -ia. (Kind of like Terraria, coming from Terrain and adding the -ia)
Offline
bo because it does not relate to scratch
Offline
poopo wrote:
slinger wrote:
Can someone recommend some really good Java books?
Sams teach yourself java in 24 hours by rogers cadenhead.
Yes.
Offline
bump
Offline
ProgrammingFreak wrote:
poopo wrote:
slinger wrote:
Can someone recommend some really good Java books?
Sams teach yourself java in 24 hours by rogers cadenhead.
Yes.
i got that book hes pretty funny and good at teaching but you need NetBeans for it free download
Offline
slayerrobe7 wrote:
ProgrammingFreak wrote:
poopo wrote:
Sams teach yourself java in 24 hours by rogers cadenhead.Yes.
i got that book hes pretty funny and good at teaching but you need NetBeans for it free download
I believe he says you can get other versions, it's your decision.
But yeah, all the screenshots are of Netbeans, save a few on Android. Cause Eclipse has a Android app plugin.
Offline
how to i make it so a project will run off of a file on the destop instead of having to run it threw a compiler every time
Offline
slayerrobe7 wrote:
how to i make it so a project will run off of a file on the destop instead of having to run it threw a compiler every time
Export it as a runnable .jar file.
Offline
16Skittles wrote:
slayerrobe7 wrote:
how to i make it so a project will run off of a file on the destop instead of having to run it threw a compiler every time
Export it as a runnable .jar file.
how???
Offline
slayerrobe7 wrote:
16Skittles wrote:
slayerrobe7 wrote:
how to i make it so a project will run off of a file on the destop instead of having to run it threw a compiler every time
Export it as a runnable .jar file.
how???
Offline