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
The feedforward part of the conversation should do all of the following except __________.a.identify the toneb.introduce the pur
polet [3.4K]

Answer:

give leave taking clues

Explanation:

The feed forward part of the conversation should do all of the following except <u>give leave taking clues</u> a identify the tone introduce the purpose give leave-taking clues establish a time-frame

3 0
3 years ago
If a computer reboots itself on its own the computer might have a(n)
MissTica

Answer:

D. Software Problem

Explanation:

It could be that the software is bootlooping which will power on and off until its fixed.

4 0
3 years ago
What is output in computer?​
Goryan [66]

Answer:

An output is data that a computer sends. An input device is something you connect to a computer that sends information into the computer. An output device is something you connect to a computer that has information sent to it.

Output is defined as the act of producing something, the amount of something that is produced or the process in which something is delivered. An example of output is the electricity produced by a power plant. An example of output is producing 1,000 cases of a product.

3 0
3 years ago
Which specific attribute of a team player helps remove ambiguity from tasks?
Rama09 [41]
If a team player knows how to follow the rules, ambiguities can be prevented. Each member would be guided by specific details of their tasks and procedures. There is a clear definition of work premises that can avoid overlapping of work. This can give better productive results.
5 0
3 years ago
Read 2 more answers
How do i write this in c++ = scnr.nextInt();<br> please help
LenaWriter [7]
Int whatever = scnr.nextInt();



Although usually when a class has a next* member function, it usually needs to check that there IS a next, that you haven't reached the end. Without knowing the class that scnr was instantiated from, I can't guess.
7 0
3 years ago
Other questions:
  • A pacing calendar is provided to students so they can:
    8·2 answers
  • A Color class has three int color component instance variables: red, green, and blue. Write a toString method for this class. It
    13·1 answer
  • In the mouse properties Window, you Can
    6·1 answer
  • What is the name of the virus that appears to be a legitimate program?
    5·1 answer
  • When parking uphill on a street with no curb, how should your front wheels be positioned? A. Turned to the left (toward the stre
    14·2 answers
  • Which type of security software prevents, detects, and removes the malware program that tries to collect personal information or
    8·2 answers
  • Which marketing strategy is represented by advertisers paying for online display ads?
    8·1 answer
  • What is the benefit of making an archive folder visible in the Outlook folder list?
    6·1 answer
  • 3
    7·2 answers
  • What is business agility
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!