O'Reilly logo

Beginning Programming with Java For Dummies, 5th Edition by Barry A. Burd

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5

Composing a Program

IN THIS CHAPTER

check Reading input from the keyboard

check Editing a program

check Shooting at trouble

Just yesterday, I was chatting with my servant, RoboJeeves. (RoboJeeves is an upscale model in the RJ-3000 line of personal robotic life-forms.) Here’s how the discussion went:

  • Me: RoboJeeves, tell me the velocity of an object after it’s been falling for three seconds in a vacuum.
  • RoboJeeves: All right, I will. “The velocity of an object after it’s been falling for three seconds in a vacuum.” There, I told it to you.
  • Me: RoboJeeves, don’t give me that smart-alecky answer. I want a number. I want the actual velocity.
  • RoboJeeves: Okay! “A number; the actual velocity.”
  • Me: RJ, these cheap jokes are beneath your dignity. Can you or can’t you tell me the answer to my question?
  • RoboJeeves: Yes.
  • Me: “Yes,” what?
  • RoboJeeves: Yes, I either can or can’t tell you the answer to your question.
  • Me: Well, which is it? Can you?
  • RoboJeeves: Yes, I can.
  • Me: Then do it. Tell me the answer.
  • RoboJeeves: The velocity is 153,984,792 miles per hour.
  • Me: (After pausing to think… .) RJ, I know you never make a mistake, but that number, 153,984,792, is much too high.
  • RoboJeeves: Too high? That’s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required