1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
drek231 [11]
4 years ago
14

Java

Computers and Technology
1 answer:
VARVARA [1.3K]4 years ago
5 0

Answer:

Here are the two statements which use nextInt() to print two random integers between 0 and 9:

System.out.println(randGen.nextInt(10));

System.out.println(randGen.nextInt(10));

Explanation:

Here is the complete program:

import java.util.Scanner;   //to accept input from user

import java.util.Random;   // use to generate random numbers

public class DiceRoll {  //class definition

public static void main (String [] args)  {//start of main function  

Random randGen = new Random();   // creates a Random class object randGen

int seedVal = 0;   //sets starting point for generating random numbers

randGen.setSeed(seedVal);   //sets the seed of random number generator

System.out.println(randGen.nextInt(10));  //generates and prints the first random integer between 0 and 9 (10 is the range from 0 to 9) using nextInt method, which is used to get next random integer value from the sequence of random number generator

System.out.println(randGen.nextInt(10));   //generates and prints the second random integer between 0 and 9 (10 is the range from 0 to 9) using nextInt method

return;    }  }

Another way to write this is to initialize two int variables:

int integer1;

int integer2;

Now use two print statements to print these random integers between 0 and 9 as:

System.out.println(integer1= randGen.nextInt(10));

System.out.println(integer1= randGen.nextInt(10));

Another way to write this is:

Set the value of integer1 to a random number from 0 to 9 and same for integer2

int  integer1 = randGen.nextInt(10);

int  integer2 = randGen.nextInt(10);  

Now use two print statements to print these random integers between 0 and 9 as:  

System.out.println(integer1);

System.out.println(integer2);

You might be interested in
How did the invention of the printing press affect society?
MrMuchimi

Answer:

A. More people could influence the media of that time

Explanation:

Its immediate effect was that it spread information quickly and accurately. This helped create a wider literate reading public. However, its importance lay not just in how it spread information and opinions, but also in what sorts of information and opinions it was spreading.

8 0
2 years ago
What is the purpose of a title slide? A) To add titles to each slide B) To introduce the presentation C) To describe the resolut
makvit [3.9K]

B) To introduce the presentation

5 0
3 years ago
Read 2 more answers
If a user wished to insert a triangle or a callout figure in a document, he or she should select the _____ option.
Vlada [557]
The Insert Tab option

You can add a shape your word, excel or PowerPoint document to make a drawing. To do this in MS Word, click on the Insert tab, and in the illustration group, click on the shapes option. Click the shapes or callouts that you would like to insert and then drag to place the shape anywhere in the document.






4 0
3 years ago
Play-e-ball, a company that creates games for gaming consoles, gathers data from the information systems of its partners, suppli
ad-work [718]

Answer:

Option B

Explanation:

It is the perfect example of BI(Business Intelligence).

7 0
3 years ago
URGENT HELP PLEASE
zysi [14]

Answer:

sorry i thought i knew it sorry

Explanation:

3 0
3 years ago
Other questions:
  • What company was credited with developing the first smartphone?
    6·2 answers
  • "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequen
    10·1 answer
  • 2. Because technology is always changing, there are new applications being developed constantly. (1 point)
    9·2 answers
  • What are the best ways to find data within a spreadsheet or database? Check all that apply. sorting tools the help function scro
    11·2 answers
  • What is the name of the worm that was written in 1988 that could replicate itself across computers on the internet?
    7·1 answer
  • Write down a scratch program which:
    5·1 answer
  • While organizing his computer's power cords, Matt realizes his printer power cord is frayed (coming apart). What should Matt do
    10·1 answer
  • In excel online what is it called when you join connecting cells together to span across more than one column and/or row?
    7·2 answers
  • Explain why microcomputers are installed with TCP/IP protocols?​
    15·1 answer
  • In what Career Cluster you get to design, build, and destroy things
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!