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
An attacker has obtained the logon credentials for a regular user on your network. Which type of security threat exists if this
jarptica [38.1K]

Answer:

privilege escalation.

Explanation:

An access control can be defined as a security technique use for determining whether an individual has the minimum requirements or credentials to access or view resources on a computer by ensuring that they are who they claim to be.

Simply stated, access control is the process of verifying the identity of an individual or electronic device. Authentication work based on the principle (framework) of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication and authorization is used in access control, to ensure a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification

Hence, an access control list (ACL) primarily is composed of a set of permissions and operations associated with a user account or new technology file system (NTFS) file such as full control, read only, write, read and execute and modify.

In this scenario, an attacker or hacker was able to obtain the logon credentials for a regular user on your network. Thus, the type of security threat which exists if this user account is used by the attacker or hacker to perform administrative functions is privilege escalation.

Privilege escalation can be defined as a network or security threat which involves the exploitation of a design flaw, bug or unsecured configuration settings in a software program (application), operating system (OS), computer system, etc., so as to have an unauthorized access and gain more permissions, elevated rights or privileges that are normally protected from a user account or software program.

Hence, when an attacker or malicious user such as a hacker gains an unauthorized access to the privileges of another user account beyond what is intended or entitled to a user, it is known as privilege escalation.

6 0
3 years ago
Since all Java data types (numbers, strings, etc) can be represented as strings, the _______ format specifier can receive any ty
astra-53 [7]

In Java programming, the <u>%s</u> format specifier can receive any type of Java data.

<h3>The kinds of data type.</h3>

In Computer programming, there are five recognized data types and these include:

  • Integer type (int).
  • Character type (char).
  • Floating point type (float).
  • Boolean (bool)
  • String (str)

<h3>What is a string?</h3>

A string is a data type which is typically used for data values that comprises ordered sequences of characters.

In Java programming, strings can be used to represent all Java data types such as numbers, Boolean, strings, etc. Also, the <u>%s</u> format specifier can be used by a programmer or software developer to receive any type of Java data.

Read more on a string here: brainly.com/question/25619349

5 0
2 years ago
In word, the ____ presents the most accurate view of how your document will look when printed, displaying the entire page on scr
makkiz [27]
<span>When using Microsoft Word, the "Print Preview" presents the most accurate view of how the document will look when it is printed. When using "Print Preview" the entire page is displayed on screen, making it easier to see what adjustments should be made to the page layout, such as spacing or text size.</span>
7 0
3 years ago
The "edit" command must allow the user to find a record in the list by director. If there are multiple records with the same dir
sveticcg [70]

Answer:

To allow user to assign rating

Explanation:

The basic function of “rate” command is to give opportunity to the user to assign a value to a song from the range of 1 – 5.

In the range, the value of 1 indicates the lowest rating, while value of 5 is the highest rating that can be obtained.

Any previous ratings are then replaced by the new rating assigned from the range of 1 – 5.

7 0
3 years ago
NO LINKS OR I WILL DELETE YOUR FORTNITE ACCOUNT
ozzi

Answer:

can i have ur fortnite account if u hav one and dont use it :) i only say that cuz u mentioned fortnite

Explanation:

with the free version you can add effects (cheap effects) cut the video, crop some parts. and posting leaves a watermark until u buy money

5 0
3 years ago
Other questions:
  • Write a MATLAB script using the quiver and contour commands to visualize the field and its divergence. Assume the region of inte
    12·1 answer
  • Which of these is a social consequence of effective communication
    12·1 answer
  • Suppose your friend, who is a small business owner, wants to computerize her business functions such as accounting, payroll, and
    7·1 answer
  • If you can't get the keys away from a drunk friend, it is better to call the police than to let them drive drunk. A. True B. Fal
    10·1 answer
  • Explain how being a metal, metalloid, or non-metal affects conductivity
    10·1 answer
  • PLEASE HELP ASAP!!
    11·2 answers
  • Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.
    8·1 answer
  • Type of file containing instructions that tell your computer how to perform ___
    9·1 answer
  • What does Technology mean to you?​
    9·2 answers
  • Differenciate between foreign key and primary key in database.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!