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]
2 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]2 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
Write out a shorthand version of the border property which will apply border that is 5 px wide, colored in lightgreen, and solid
Sever21 [200]

Answer:

border: 5px solid lightgreen;

Explanation:

The shorthand version of the border property in CSS goes as follows:

 border: <line-width> <line-style> <color>;

With <line-width> represents the thicknes of the border line (expressed in keyword values or lenght values), <line-style> represents the style of the border, and <color> represents the color of the border (in color names or values).

6 0
2 years ago
In which conditions, a trial balance does not tally?
Nostrana [21]

Answer:

A trial balance will not balance if both sides do not equal, and the reason has to be explored and corrected.

Explanation:

The debit side and the credit side must balance, meaning the value of the debits should equal the value of the credit

4 0
2 years ago
A computer reads a sequence from top to bottom and left to right? True or False
Nat2105 [25]
The answer is False
5 0
2 years ago
In which of the following work situations would word processing software be most appropriate to make the task easier?
Olegator [25]
Where is the situations?

3 0
3 years ago
Write an if/else statement that compares the value of the variables soldYesterday and soldToday, and based upon that comparison
jenyasd209 [6]

Answer:

if(soldYesterday > soldToday){

salesTrend = -1;

} else if(soldToday > soldYesterday){

salesTrend = 1;

}

Explanation:

The if/else statement is more explicit. The first if condition check if soldYesterday is greater than soldToday, if true, then -1 is assigned to salesTrend.

Else if soldToday is greater than soldYesterday, if true, then 1 is assigned to salesTrend.

7 0
2 years ago
Other questions:
  • WHAT IS SQL AND HOW CAN YOU MEET THE DATA REQUIREMENTS ALSO MAINTAINING DATA INTEGRITY,AND LASTLY STATE THE FULL MEANING OF SQL
    11·1 answer
  • An array UnsortedInt consists of integers in random order. Another array SortedInt consists of a sorted list of integers.
    13·1 answer
  • When will it be determined whether or not a donor's organs are fit for recovery and transplantation?
    10·2 answers
  • PLEASE HELP POWER POINT:
    8·2 answers
  • Two different ways to bring up My Computer folder
    11·1 answer
  • In cell I8, enter a nested logical function to display Need to Remodel if the apartment is unoccupied (No) AND was last remodele
    9·1 answer
  • Identify a stressor in your life. Conduct an internet search to locate at least two reliable sources of information on effective
    6·1 answer
  • Write the contrapositive of each of the following statements. Healthy plant growth follows from sufficient water. Increased avai
    7·1 answer
  • Create an application that determines the final cost of food items and non-food items, assuming only non-food items are taxed. T
    8·1 answer
  • What was the first computer
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!