Computers and Technology
Computers and Technology, 10.05.2021 19:10, DBE12

Create a game that rolls two dies (number from 1 to 6 on the side) sequentially for 10 times (use loop). If at least once out of 10 times the sum of two random numbers is equal to 10, you win, else you loose. You will need to get your own method getRandom(int n) that generates a random number, see below (you can modify it as needed), a loop, and IF statement in the loop that checks if a sum of two random numbers is 10 or not. Please start your program as follows, similar to what we did in class:
import java. util. Random;
public class UseRandom{
//your method getRandom() is here below, n is a range for a random number from 0 to n
public int getRandom(int n)
{
Random r=new Random();
int rand=r. nextInt(n);
return rand;
}
//code continues here, don't forget your main() method inside the class, and making your own object in main() using "new" keyword.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:30, devnnn44
What is the original authority for copyright laws
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, alexacarillo
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, ayoismeisjjjjuan
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
image
Computers and Technology, 24.06.2019 04:30, andrespacheco5888
Which of the following terms refers to a collection of different types of software that share the goal of infiltrating a computer and making it do something? a- malware b- virus c- spyware d- trojan horse
Answers: 2
Do you know the correct answer?
Create a game that rolls two dies (number from 1 to 6 on the side) sequentially for 10 times (use lo...

Questions in other subjects:

Konu
Mathematics, 18.03.2021 01:50
Konu
Social Studies, 18.03.2021 01:50