Author Topic: [Java] cs1.Keyboard  (Read 7633 times)

0 Members and 1 Guest are viewing this topic.

Offline AntiVirus

  • Legendary
  • x86
  • Hero Member
  • *****
  • Posts: 2521
  • Best
    • View Profile
[Java] cs1.Keyboard
« on: March 14, 2006, 04:09:47 pm »
Does anyone know where to find the cs1.Keyboard package at?  I looked on google and I couldn't find a site to download it at.  I found a site that is asking this same question on Sun's forums, but I couldn't connect to the site.

So, does anyone know where to download it at?
The once grove of splendor,
Aforetime crowned by lilac and lily,
Lay now forevermore slender;
And all winds that liven
Silhouette a lone existence;
A leafless oak grasping at eternity.


"They say that I must learn to kill before I can feel safe, but I rather kill myself then turn into their slave."
- The Rasmus

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [Java] cs1.Keyboard
« Reply #1 on: March 14, 2006, 05:33:57 pm »
What's it do?
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: [Java] cs1.Keyboard
« Reply #2 on: March 14, 2006, 05:48:31 pm »
www.google.com

"java Keyboard class" (no quotes), "I'm Feeling Lucky."

http://duke.csc.villanova.edu/jss/keyboard.html

By the way, are you doing this in high school?  That's from the textbook my CSE200 class used in college.
« Last Edit: March 14, 2006, 06:17:12 pm by MyndFyre[x86] »
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline AntiVirus

  • Legendary
  • x86
  • Hero Member
  • *****
  • Posts: 2521
  • Best
    • View Profile
Re: [Java] cs1.Keyboard
« Reply #3 on: March 14, 2006, 11:36:32 pm »
Yeah, I got this from my highschool.  Right now though, I am doing it alone and I happen to know the package pretty well, so I am going to stick with it.

Thanks MyndFyre.
What's it do?
Well from what I understand it just reads what the user inputs.  Such as the primitive data types and what not.  It's pretty handy. :)

[Edit]
I still get this
Quote
--------------------Configuration: j2sdk1.4.0 <Default>--------------------
C:\Documents and Settings\Brandon\My Documents\Java\OddNum.java:6: package cs1 does not exist
import cs1.Keyboard;
           ^
1 error
while trying to compile my little code.  It's in all the places it should be according to the site I found, but nothing has changed.

Site: http://duke.csc.villanova.edu/jss/keyboard.html

Any ideas?
« Last Edit: March 14, 2006, 11:59:56 pm by AntiVirus »
The once grove of splendor,
Aforetime crowned by lilac and lily,
Lay now forevermore slender;
And all winds that liven
Silhouette a lone existence;
A leafless oak grasping at eternity.


"They say that I must learn to kill before I can feel safe, but I rather kill myself then turn into their slave."
- The Rasmus

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [Java] cs1.Keyboard
« Reply #4 on: March 15, 2006, 02:29:39 am »
Ah. We have one of those from our textbook too. I don't know if you saw it or not when I posted it earlier. It's called EasyReader.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Ender

  • x86
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: [Java] cs1.Keyboard
« Reply #5 on: April 17, 2006, 11:16:40 pm »
I have developed a distaste for classes like Keyboard and EasyReader. They should allow the user to provide some of the implementation him/herself... for example, through delegation. It's true that you can subclass these classes but they give no reason to override their methods and you can't change the error messages they spit out without editing the file (which is not always possible). For instance, they could allow for delegating an object to handle error messages. While they do a good job abstracting  IO they also limit functionality... I particularly don't like EasyReader for this reason. IIRC, it does not have block IO. I find the java.io and java.nio packages to be well-suited for the job.


</rant>

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [Java] cs1.Keyboard
« Reply #6 on: April 18, 2006, 10:11:42 am »
public class NewEasyReader exteneds EasyReader
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: [Java] cs1.Keyboard
« Reply #7 on: April 18, 2006, 01:25:47 pm »
While your criticisms of the Keyboard and EasyReader classes may be valid, I'd argue that, as a teaching tool (which is what they are), they're very effective.  Besides shielding students from the relatively mundane task of retrieving input, they teach good OO design principles.  And, library usage is good; it introduces students quickly to the concept of code reuse.  When someone is new, they don't necessarily understand that the Java library is actually a library of code, as opposed to an innate part of the language.
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.