Composing a Program
IN THIS CHAPTER
Reading input from the keyboard
Editing a program
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 ...