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
RSB [31]
3 years ago
6

Which of the following expressions yields an integer between 0 and 100, inclusive? Question 5 options: (int)(Math.random() * 100

+ 1) (int)(Math.random() * 101) (int)(Math.random() * 100) (int)(Math.random() * 100) + 1
Computers and Technology
1 answer:
Alex17521 [72]3 years ago
3 0

Answer:

(b) (int)(Math.random() * 101)

Explanation:

Given

min = 0 --- minimum

max =100 --- maximum

Required

Java expression to generate random integer between the above interval

The syntax to do this is:

(int)(Math.random((max - min) + 1) + min)

Substitute the values of max and min

(int)(Math.random((100 - 0) + 1) + 0)

Simplify the expression

(int)(Math.random(100 + 1) + 0)

(int)(Math.random(101) + 0)

(int)(Math.random(101))

Hence, the right option is:

(b) (int)(Math.random() * 101)

You might be interested in
Households pay taxes to the government and receive public services. Which of the following is a public service?
Gwar [14]
C. Roads  this is the correct answer
8 0
3 years ago
Einstein's famous equation states that the energy in an object at rest equals its mass times the squar of the speed of light. (T
musickatia [10]

Answer:

The complete program is as follows:

m_str = input('Input m: ')

mass = float(m_str)

e = mass * 300000000**2

print("e = ",e)

Explanation:

This is an unchanged part of the program

m_str = input('Input m: ')

This converts m_str to float

mass = float(m_str)

This calculates the energy, e

e = mass * 300000000**2

This is an unchanged part of the program

print("e = ",e)

4 0
3 years ago
A string variable can hold digits such as account numbers and zip codes.<br><br> FALSE<br><br> TRUE
gavmur [86]
True. The second one is right
6 0
3 years ago
List down any 5 Advantages and any 5 Disadvantages of Computers
Dahasolnce [82]

Advantages

Increase your productivity. ...

Connects you to the Internet. ...

Can store vast amounts of information and reduce waste. ...

Helps sort, organize, and search through information. ...

Get a better understanding of data. ...

Keeps you connected. ...

Help you learn and keep you informed. ...

Can make you money.

Disadvantages

Too much sitting. ...

Carpal tunnel and eye strain. ...

Short attention span and too much multitasking. ...

Potential of loss of privacy. ...

Can limit learning and create a dependency. ...

Time sink and lots of distractions....

5 0
3 years ago
Read 2 more answers
I have a message for anyone reading this
uysha [10]

Answer:zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Explanation:

4 0
3 years ago
Other questions:
  • In your opinion, is it more beneficial to have many folders or is it better to “nest” subfolders? Explain your response.
    10·2 answers
  • What default length is used for the ospf dead interval?
    14·1 answer
  • Which field can be used to track the progress on tasks that a user has created?
    10·1 answer
  • the piece of hardware that contains the circuitry that processes the information coming in to the computer
    13·1 answer
  • .Ashley is creating a new logo for her client that should be a vector graphic. Which is classified as a vector editing software?
    8·1 answer
  • According to your text, three factors are responsible for the rapid rise in new product development. They are faster and more ec
    9·1 answer
  • Write an expression that computes the integer average of the int variables exam1 and exam2 (both declared and assigned values).
    15·1 answer
  • What color mode would you use when designing for web &amp; devices?
    9·1 answer
  • Write a program that uses nested loop or for statements to display Pattern A below, followed by an empty line and then another s
    5·1 answer
  • Need help please. this effect my technology
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!