This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Pay No Attention To The Man Behind The Curtain 1. Introduction It has been a rough few weeks and now midterms. Because we are certain all of the Comp11 students are tired of answering questions, we are going to write a program to answer all of your questions... The Magic Eight Ball: The magic eight ball has been used for centuries, or at least as since before Professor Hescott was your age. The way it works is you ask it a question, shake it, turn it upside down and it returns an answer. (Some say a random answer; some say it speaks the truth.) The set of answers are things like: “Yes”, “No”, “Maybe”, “Sometimes it is true.”, “My sources say no”, “Alas, it has been tried before” , etc. We will consider a digital version of “The Ball”, as it ʼ s known among friends. A user will type in a question to the computer at the given prompt and the computer will generate a random answer from a set of messages. 2. Implementation The messages are stored in a Fle. There are actually two Fles, one appropriately named, “messages”, the other similarly named, “messages2”. Students will read in the text Fles to store messages similarly named, “messages2”....
View Full Document
- Fall '08
- 4 , Professor Hescott