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]
3 years ago
14

Java

Computers and Technology
1 answer:
VARVARA [1.3K]3 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
Information systems security is the collection of activities that protect the information system and the data stored in it.
ivann1987 [24]

Answer:

The answer is A. True.

Explanation:

Information systems security,refers to all the methods involved with assuring information integrity as well as keeping it confidential, and available.

It can also be defined as -

The detection and provisoon of solutions to security breaches.

Access controls, which prevents unauthorized system access.

Protection of information either in transit or in a storage area.

3 0
3 years ago
The top of a ladder must extend how many feet above the surface a worker is climbing onto?
Alika [10]
<span>The answer is THREE FEET. This is part of the safety precautions that must be taken when using ladder. Other safety precautions include: only used inspected and certified ladders, keep ladders at least ten feet away from power lines, do not use ladder on slippery surfaces, etc.</span><span />
6 0
3 years ago
What is the reason for taking care of design a good computer human interface ​
anygoal [31]

Answer:

computer is one of the part of our technology so that let's take care of it and improve so that we can used for better and sufficient ly not maybe now but maybe soon.

3 0
3 years ago
Read 2 more answers
The picture above is a description of the C code below. Please modify the C below so that it uses FILE HANDLING (fopen, fputs, f
siniylev [52]

Answer: i just learned something new.

Explanation:

3 0
3 years ago
Roger wants to give semantic meaning to the contact information, which is at the bottom of the web page. To do this he will use
Elden [556K]

Answer:

Parent

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head. The head contains information such as version of HTML, title of a page, metadata, link to custom favicons and CSS etc. The body of a HTML document contains the contents or informations that a web page displays.

In this scenario, Roger wants to give semantic meaning (an element conveying informations about the type of content contained within an opening and closing tag) to a contact information placed at the bottom of a webpage. Thus, in order to do this, he should use a footer element as a parent of the contact information and as such all instance variables that have been used or declared in the footer class (superclass) would be present in its contact information (subclass object).

4 0
2 years ago
Other questions:
  • Can u suggest me some Hindi movies that is on you-tube please suggest
    7·2 answers
  • Discuss two advantages and two disadvantages of agile methods.
    6·1 answer
  • In 1-2 sentences, describe how to change the font.
    8·2 answers
  • Using Visio, create a Local Area Network (LAN) consisting of 12 computers, a switch, and three printers. The switch should be in
    11·1 answer
  • To create a chart, you need to select at least
    8·1 answer
  • When classified data is sent over an unclassified network, what is this incident called?
    5·1 answer
  • A company has a hybrid ASP.NET Web API application that is based on a software as a service (SaaS) offering.Users report general
    9·1 answer
  • Who is big brain me or you
    14·1 answer
  • What version of java do i have installed.
    6·1 answer
  • The unit we use to measure bending moment is...<br> A kg<br> B N<br> C Nm<br> D MPa
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!