This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#201 2012-03-23 08:38:26

maxskywalker
Scratcher
Registered: 2008-01-27
Posts: 1000+

Re: Java Official Topic

Um, just so you know, you can keep using the same Scanner object.

Offline

 

#202 2012-03-23 08:50:14

Laternenpfahl
Scratcher
Registered: 2011-06-24
Posts: 1000+

Re: Java Official Topic

If not x==max and not x==mid then x=middle
-ish?


http://i46.tinypic.com/6yd4c0.png

Offline

 

#203 2012-03-23 15:55:11

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Java Official Topic

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!


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#204 2012-03-27 07:01:40

matthew8092001
Scratcher
Registered: 2010-09-12
Posts: 100+

Re: Java Official Topic

nvm, I've got it.

By the way, how do you calculate the mode?
I've already got the mean and median.

Code:

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]);
        
        
    
        
    
            }
    
            
        }

http://1.bp.blogspot.com/_GVA115I1I8Y/TMGwbJ056kI/AAAAAAAABHs/kpvg0oCKV2g/s1600/happy.gif
lol

Offline

 

#205 2012-04-11 15:25:07

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Java Official Topic

Making my first game in Java. :DDD

Offline

 

#206 2012-04-11 15:56:30

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: Java Official Topic

I know this is naughty but i just learn whatever i need for it to work  tongue


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#207 2012-04-11 16:05:30

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Java Official Topic

ProgrammingFreak wrote:

Making my first game in Java. :DDD

Are you using lwjgl?


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#208 2012-04-11 16:14:44

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Java Official Topic

poopo wrote:

ProgrammingFreak wrote:

Making my first game in Java. :DDD

Are you using lwjgl?

Yes, I will be.
Well, I hope so.  tongue

Last edited by ProgrammingFreak (2012-04-11 16:14:59)

Offline

 

#209 2012-04-11 16:18:31

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: Java Official Topic

Lol thanks for bringing this back up.  tongue
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!  tongue
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"  tongue


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#210 2012-04-11 16:23:00

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Java Official Topic

16Skittles wrote:

Lol thanks for bringing this back up.  tongue
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!  tongue
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"  tongue

Okay, nice.  big_smile

Offline

 

#211 2012-04-11 16:45:49

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Java Official Topic

16Skittles wrote:

Lol thanks for bringing this back up.  tongue
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!  tongue
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"  tongue

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)


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#212 2012-04-11 20:31:12

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: Java Official Topic

poopo wrote:

16Skittles wrote:

Lol thanks for bringing this back up.  tongue
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!  tongue
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"  tongue

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)


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#213 2012-04-11 21:38:42

Zangooser
Scratcher
Registered: 2012-03-18
Posts: 1000+

Re: Java Official Topic

...shouldn't this go in the Advanced Topics forum? XP
/SorryForMyN00biness


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/O0efo.png&amp;link2=http://i.imgur.com/B1KzK.png

Offline

 

#214 2012-04-12 02:07:45

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: Java Official Topic

bo because it does not relate to scratch


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#215 2012-04-14 08:06:08

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Java Official Topic

Can someone recommend some really good Java books?


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#216 2012-04-14 15:48:46

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Java Official Topic

slinger wrote:

Can someone recommend some really good Java books?

Sams teach yourself java in 24 hours by rogers cadenhead.


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#217 2012-04-14 15:54:55

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Java Official Topic

poopo wrote:

slinger wrote:

Can someone recommend some really good Java books?

Sams teach yourself java in 24 hours by rogers cadenhead.

Yes.

Offline

 

#218 2012-04-15 14:40:44

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Java Official Topic

Hey thanks! I'll look at it!
I'm also planning on getting "Java by example 2". :3


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#219 2012-05-01 00:35:46

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: Java Official Topic

bump


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#220 2012-05-01 00:41:36

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: Java Official Topic

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


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#221 2012-05-02 08:28:15

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Java Official Topic

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.  smile
But yeah, all the screenshots are of Netbeans, save a few on Android. Cause Eclipse has a Android app plugin.

Offline

 

#222 2012-08-09 15:59:22

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: Java Official Topic

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


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#223 2012-08-09 17:26:47

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: Java Official Topic

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.


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#224 2012-08-09 17:29:59

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: Java Official Topic

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???


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#225 2012-08-09 17:54:41

Ecliptic
Scratcher
Registered: 2012-02-27
Posts: 500+

Re: Java Official Topic

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???

http://www.mycoding.net/2011/02/compili … n-eclipse/


If you can read this you are in range.

Offline

 

Board footer