subject
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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:10
Suppose we have a byte addressable computer that has a 32-byte cache with 8 bytes per block. the memory address is 8 bits long. the system accesses memory addresses (in hex) in this exact order: 6e, b9, 17, e0, 4e, 4f, 50, 91, a8, ab, ad, 93, and 94. (a) assuming the cache is direct mapped, what memory addresses will be in cache block 2 after the last address has been accessed? (b) assuming the cache is direct mapped, what is the hit ratio for the entire memory reference sequence given, assuming the cache is initially empty? (c) assuming the cache is 2-way set associative with a lru replacement policy, what is the hit ratio?
Answers: 3
question
Computers and Technology, 22.06.2019 19:40
Solve the following javafx application: write a javafx application that analyzes a word. the user would type the word in a text field, and the application provides three buttons for the following: - one button, when clicked, displays the length of the word.- another button, when clicked, displays the number of vowels in the word.- another button, when clicked, displays the number of uppercase letters in the word(use the gridpane or hbox and vbox to organize the gui controls).
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
Companies that implement and apply an information system effectively can create
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
List 3 items that were on kens resume that should have been excluded
Answers: 1
You know the right answer?
Create a game that rolls two dies (number from 1 to 6 on the side) sequentially for 10 times (use lo...
Questions
question
Computers and Technology, 28.08.2019 11:00
question
Mathematics, 28.08.2019 11:00
Questions on the website: 13722359