subject

Write a program that simulates a Magic 8 Ball, which is a fortune-telling toy that displays a random response to a yes or no question. In the student sample programs for this book, you will find a text file named 8_ball_responses. txt. The file contains 12 responses, such as "I donât think so," "Yes, of course!," "Iâm not sure," and so forth. The program should read the responses from the file into an array or ArrayList object. It should prompt the user to ask a question, and then display one of the responses, randomly selected from the array or ArrayList object. The program should repeat until the user is ready to quit. You will need to create two .java files for this assignment: a Magic 8 Ball Class and a Demo class. All methods should be documented with javadoc style comments. Contents of 8_ball_responses. txt:Yes, of course!Without a doubt, yes. You can count on it. For sure!Ask me later. Iâm not sure. I canât tell you right now. Iâll tell you after my nap. No way!I donât think so. Without a doubt, no. The answer is clearly NO.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 15:10, kamkam5791
Chiko bought 75 shares of stock at $19.58 per share. he received dividends of $73.42 during the year. at the end of the year, his stock was valued at $22.14. what was his purchase price?
Answers: 2
image
Computers and Technology, 22.06.2019 21:00, bryanatwin1536
Describir textbook icon_person mira los dibujos y describe lo que está pasando. usa los verbos de la lista.
Answers: 1
image
Computers and Technology, 22.06.2019 22:10, Metlife
Asequential circuit contains a register of four flip-flops. initially a binary number n (0000 ≤ n ≤ 1100) is stored in the flip-flops. after a single clock pulse is applied to the circuit, the register should contain n + 0011. in other words, the function of the sequential circuit is to add 3 to the contents of a 4-bit register. design and implement this circuit using j-k flip-flops.
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, elizabethburkha
Which text format is this, "the text is transcribed exactly as it sounds and includes all the utterances of the speakers. "?
Answers: 2
You know the right answer?
Write a program that simulates a Magic 8 Ball, which is a fortune-telling toy that displays a random...

Questions in other subjects: