Computer Science Canada

User input with Ready to Program (Holtsoft) without using the hsa console?

Author:  Rickkwa [ Tue Mar 29, 2011 3:13 pm ]
Post subject:  User input with Ready to Program (Holtsoft) without using the hsa console?

Yeah, so I'm wondering how to get user input using Ready and without using the hsa console. I think I found it on a site before and I was able to get integers at the very least, but I forgot the site and how to do it.

Author:  DemonWasp [ Tue Mar 29, 2011 3:16 pm ]
Post subject:  RE:User input with Ready to Program (Holtsoft) without using the hsa console?

code:
Scanner in = new Scanner ( System.in )


Alternately, use any of the other classes in java.io.* ; the simplest way is still to use Scanner.

Author:  Rickkwa [ Tue Mar 29, 2011 8:04 pm ]
Post subject:  Re: User input with Ready to Program (Holtsoft) without using the hsa console?

I mentioned Ready to Program because it's using an older version of java (i think) and scanner isn't built in.

Author:  Tony [ Tue Mar 29, 2011 8:09 pm ]
Post subject:  RE:User input with Ready to Program (Holtsoft) without using the hsa console?

java.io.InputStream has been available since 1.0 (and yes, Scanner has been introduced in Java 5)

Author:  DemonWasp [ Tue Mar 29, 2011 9:26 pm ]
Post subject:  RE:User input with Ready to Program (Holtsoft) without using the hsa console?

*facepalm*

You're right, Scanner isn't available in Ready (Java 1.4.2, as I recall now).

You will need to use InputStream / Reader and the Integer.parseInt, Double.parseDouble, etc methods.

Or, you could use a JVM that's less than 9 years old (and at least 6.5 years out of date). I strongly, strongly recommend this latter case -- usage of Java 1.4 has dropped off drastically, largely due to Java 1.5 and 1.6 (and 1.7, assuming they ever release it) being vastly superior.


: