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]
2 years ago
13

What does the following code segment do?

Computers and Technology
1 answer:
vampirchik [111]2 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
What does limited access to a document mean?
OverLord2011 [107]
Limited access to a document usually means that the creator of the document is able to limit how much access one person is able to get.
8 0
3 years ago
Read 2 more answers
TRUE OR FALSE: THE BUILDER'S CLUB IS A PAID SUBSCRIPTION.
nadya68 [22]

Answer:

true

Explanation:

3 0
2 years ago
Read 2 more answers
Xavier buys a new laptop for $540. He makes a down payment $75 and pays the rest in 6 equal monthly payments, p. What equation r
mylen [45]

Explanation:

so you want to subtract 540-75=465

so 465 is what he has to pay total so now we break it up into equal parts

465/6=77.5

so he would pay $77

3 0
3 years ago
IP ______ occurs when an intruder computer fools a network into believing its IP address is associated with a trusted source.
Veseljchak [2.6K]

Answer:

Spoofing

Explanation:

Spoofing that occurs when an intruder computer fools network into believing its IP address is associated with trusted source

5 0
2 years ago
Citations that are ______________________________ can be used to build a bibliography when needed. [Create and Modify Citation S
VMariaS [17]

Answer:

I think the best option would be C. Marked

Explanation:

hope this helps and sorry if it is incorrect.

8 0
3 years ago
Other questions:
  • For some brand-name computers, the hard drive contains a partition that can be used to reinstall windows. what is the name for t
    6·1 answer
  • reate a class called Plane, to implement the functionality of the Airline Reservation System. Write an application that uses the
    5·1 answer
  • Changing the position of the wing will
    9·1 answer
  • A ____ typically rests on the desk or other flat surface close to the user’s computer, and it is moved across the surface with
    13·1 answer
  • What are lexical errors?<br> and fi(a==b)<br> will it be a lexical error or a syntactical error?
    8·1 answer
  • What is IaaS? For this service model, what are the resources the cloud vendor will provide/manage and what are the resources the
    15·1 answer
  • Someone please help me with the right answer please
    12·1 answer
  • What will be the results of the following code? final int Array_Size = 5;An error will occur when the program runs. There will b
    10·1 answer
  • Ha Yoon sees funny quotes on top of images frequently in her social media feed. One day, she has an idea for one of her own. Whi
    11·1 answer
  • Today's manufacturing workplace is most likely to include
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!