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
gayaneshka [121]
3 years ago
8

What is the possible output from system.out.println((int)math.random() * 4)?

Computers and Technology
1 answer:
antiseptic1488 [7]3 years ago
6 0
<span>int randomWithRange(int min, int max) {
    int range = (max - min) + 1;
    return (int)(Math.random() * range);
}</span>

Output of randomWithRange(2, 5) 5 times:

3 0 1 1 0

You might be interested in
Write a java program that accepts the ingredients for a recipe in cups and converts to ounces
Tanzania [10]

Answer:

Explanation:

public static int cupsToOunces (int cups) {

   

       int ounces = cups * 8;

       return ounces;

       

   }

This is a very simple Java method that takes in the number of cups in the recipe as a parameter, converts it to ounces, and then returns the number of ounces. It is very simple since 1 cup is equal to 8 ounces, therefore it simply takes the cups and multiplies it by 8 and saves that value in an int variable called ounces.

6 0
3 years ago
Which is a correct explanation of first lines?
tatyana61 [14]

The correct explanation of the first line in poems is; Choice B; The first lines determine all of the poet's subsequent choices.

<h3>Meaning of poem</h3>

By literature definition, a poem is a piece of writing in which the words are chosen for their beauty and sound and are carefully arranged, often in short lines which rhyme.

To ensure that these short lines in poems rhyme, the first line serves as a template and consequently, determines all of the poet's subsequent choices.

Read more on poems and first line;

brainly.com/question/4343450

8 0
3 years ago
For the following questions, consider a paged memory system that has a physical main memory size of 32KB (215) and a page frame
dlinn [17]

Complete Question

For the following questions, consider a paged memory system that has a physical main memory size of 32KB (215) and a page frame size of 8KB (213). Consider a process P whose logical address space is 64KB (216). Important Note: If an answer requires an exponent, use the ^ character. For example: 216 would be entered as 2^16.

Question 1: How many physical page frames are there in the above paged memory system? ________(Your answer should be in exponential form)

How many bits are needed to represent a physical page frame number in the system? ____________

Question 2: How many logical pages are there for P? _____________(Your answer should be in exponential form. )

How many bits are needed to represent a logical page number for P? _____________

Answer:

1a) The number of physical page frames in the  paged memory system = 2⁵

1b) The number of bits that can be used to represent the physical page frame = 5 bits

2a) Number of logical pages = 2³

2b) Number of logical frame bits = 3 bits

Explanation:

Size of physical main memory = 32 kB = 2¹⁵

Space for Logical address = 64 KB = 2¹⁶

Page frame size = 8 KB = 2¹³

1a) The number of physical page frames in the  paged memory system

Number of page frames = physical main memory size / page frame size

 Number of page frames  = 2¹⁵ / 2¹³

Number of page frames = 2⁵

1b)The number of bits that can be used to represent the physical page frame

physical memory size = log2(2²⁰) = 20 bits.

Offset bits = log2(2¹⁵)  = 15 bits

Frame bits = physical memory size – offset bits

Frame bits = 20 – 15

Frame bits = 5 bits

2a)  Number of logical pages = logical address space / page frame size

Number of logical pages = 2¹⁶/2¹³

Number of logical pages = 2³

2b) Logical address space = log2(2¹⁶) = 16 bits

Offset bits = log2(2¹³)

Offset bits = 13 bits

Frame bits = logical address space bits – offset bits

Frame bits   = 16 – 13

Frame bits  = 3 bits

7 0
3 years ago
Explain two consequences that would occur, if the "Device Manager and the "File Managerstopped communicating with each other?
sladkih [1.3K]

Answer:

So, you won't be able to install driver via a file because device manager can't find it. Just reinstall windows if that happens lol.

4 0
3 years ago
The scope of a variable declared in a for loop's initialization expression always extends beyond the body of the loop
shtirl [24]

Answer:

False

Explanation:

for loop is used to run the statement again and again until the condition put inside the for loop is false.

syntax:

for(initialization;condition;increment/decrement)

{

  statement;

}

the initialization scope is valid only within the curly braces of the for loop. it is not valid outside the body of the for loop.

because initialization is the part of the for loop.

4 0
3 years ago
Other questions:
  • Operating systems are designed to work with specific hardware. Which operating system works with Apple computers?
    8·2 answers
  • In 1988, Robert Morris, Jr. launched a program called the _________ that used weaknesses in e-mail programs and operating system
    5·1 answer
  • A __________ is when the sender cryptographically marks a message with its private key, which is achieved by a cryptographic alg
    12·1 answer
  • your computer running Windows 10 is doing some very strange things with operating system you are fairly certain it is not a hard
    13·2 answers
  • The first step in transforming an extended e-r model into a relational database design is to
    14·1 answer
  • Which file is usually the first file to be displayed when you navigate to a website?
    7·1 answer
  • Inserting merge fields in the letter<br>steps required <br>plz ​
    11·2 answers
  • Help me. its due tonight
    13·1 answer
  • Pleaseee helpppppppppp
    5·1 answer
  • A pointing device used mainly for computer games is known as
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!