![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 30.05.2020 00:06 nockturnal1993
Have you ever seen a Magic 8 ball? You ask it a yes-no question and then shake it to get a random response like “Signs point to yes!”, “Very doubtful”, etc. If you’ve never seen a Magic 8 ball, check out this video.
We encourage you to work in pairs for this challenge. Come up with 8 responses to yes-no questions. Write a program below that chooses a random number from 1 to 8 and then uses if statements to test the number and print out the associated random response from 1-8. If you need help with random numbers, see lesson 2.9.
public class Magic8Ball
{
public static void main(String[] args)
{
// Get a random number from 1 to 8
// Use if statements to print out 1 of 8 responses
}
}
1
public class Magic8Ball
2
{
3
public static void main(String[] args)
4
{
5
// Get a random number from 1 to 8
6
7
// Use if statements to print out 1 of 8 responses
8
9
10
}
11
}
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 22:20, gingerham1
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 23:30, keviongardner
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 25.06.2019 07:30, nellys2096
What does the hard disk drive do? it stores all of the information on a computer. it controls a computer’s operating system. it enables visual interaction with a computer. it contains all of a computer’s internal parts.
Answers: 1
You know the right answer?
Have you ever seen a Magic 8 ball? You ask it a yes-no question and then shake it to get a random re...
Questions in other subjects:
![Konu](/tpl/images/cats/mat.png)
Mathematics, 03.07.2020 05:01
![Konu](/tpl/images/cats/ekonomika.png)
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 03.07.2020 05:01
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/informatica.png)
![Konu](/tpl/images/cats/fizika.png)
Physics, 03.07.2020 05:01
![Konu](/tpl/images/cats/mkx.png)
Arts, 03.07.2020 05:01