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
OLga [1]
3 years ago
13

What does the following code segment do?

Computers and Technology
1 answer:
vampirchik [111]3 years ago
4 0

Answer:

Hi!

var count =0;  <em>//initialize count.</em>

var sevens =0 ;  <em>//initialize sevens.</em>

while(count<100)  <em>// loops while count is minor than 100. *counts never add 1 at the final of the loop, so this while is always true. </em>

{

<em>//Math.floor(x) round to the max Integer a number. Example : 45.90 -> 46.</em>

<em>//Math.random() returns a number between [0, 1).</em>

var roll1 = Math.floor(Math.random()*6+1);   <em>//Gets a integer using Math.random(), adds 1, and round it withMath.floor() then saves in roll1.</em>

var roll2 = Math.floor(Math.random()*6+1);  <em>//Gets a integer using Math.random(), adds 1, and round it withMath.floor() then saves in roll2.</em>

if(roll1 + roll2 == 7) <em> //If the sum of roll1 and roll2 is 7 adds 1 to sevens.</em>

sevens = sevens +1;  

}

<em>//*count is not incremented, so while(count<100) -> always true.</em>

You might be interested in
Which of the following is Not included in the Web Accessibility Initiative? Don’t rely on color alone.
Doss [256]
I'm pretty sure it's D. Provide discount software for the underprivileged.
3 0
3 years ago
Explain briefly why the discovery phase is a favorite with many developers
Mamont248 [21]

Answer:

Discovery phase is the beginning step of a system development work. It is an important step for our professional staff, as people will need the information gathered to make informed technical advice for the construction effort and to provide an exact cost assessment.

Explanation:

Discovery regulates our organization with the customer’s requirements at the origin. The exercises and deliverables of outline Discovery are essential to the correctness of design evaluation and preparation, and we suggest that they always are completed for complicated custom requests with unknown and unsteady technical elements.

3 0
3 years ago
Create a logic array qualifyingIndex with true for any location where the runner is male with a running time less than 8.2. Row
larisa [96]

Rounding Numbers

Say you wanted to round the number 838.274. Depending on which place value you'll round to, the final result will vary. Rounding 838.274:

Rounding to the nearest hundred is 800

Rounding to the nearest ten is 840

Rounding to the nearest one is 838

Rounding to the nearest tenth is 838.3

Rounding to the nearest hundredth is 838.27

5 0
3 years ago
A user complains that there are not enough USB ports available on a desktop. What can a technician do to solve the problem?
pickupchik [31]
Install a USB expansion card
3 0
3 years ago
When it comes to wireless channels, which channels never overlap?
krok68 [10]

Answer:

In the 2.4 GHz band, 1, 6, and 11 are the only non-overlapping channels. Explanation:

Selecting one or more of these channels is an important part of setting up your network correctly.

6 0
2 years ago
Other questions:
  • Test if a password entered is correct. The secret phrase is Ada Lovelace. Sample Run 1 Enter the Password: Ada Lovelace Sample O
    13·1 answer
  • You can apply bold, italic, and underline styles to text. But why is it a good idea to use underline sparingly?
    13·2 answers
  • What authentication protocol is ticket-based and is used by windows computers that are members of an active directory domain?
    13·1 answer
  • You are given an array of integers, each with an unknown number of digits. You are also told the total number of digits of all t
    7·1 answer
  • What permission do users have by default regarding printer access and the ability to manage documents?
    14·1 answer
  • Clicking the ____ opens the insert function dialog box.
    13·1 answer
  • What are the features of G-mail <br><br>(Write in your own words)​
    10·2 answers
  • Helpppppppppppppppppppppppppppppppp
    13·2 answers
  • WILL MARK BRAINLIEST WORTH ALOT OF POINTS! HELP ME GET THIS DONE
    8·1 answer
  • Pls need this asap
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!