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
Kim is writing a sql query that will pull a list of customers with outstanding orders and the sales rep for each order. What sho
Step2247 [10]

What the phrase should say in Kim's SQL Query is;  WHERE Customer = Sales Rep

<h3>What is SQL Query?</h3>

Structured Query Language (SQL) is defined as a standardized programming language that is used to manage relational databases and perform various operations on the data in them.

Now in SQL Query, when one SQL query is embedded in another SQL query to simulate a join, the second SQL query is embedded in the "WHERE" of the first query.

Since the query will pull a list of customers with outstanding orders and the sales rep for each order. Then, the where phrase will be;

WHERE Customer = Sales Rep

Read more about SQL Query at; brainly.com/question/10097523

6 0
2 years ago
A _____ is a predefined text format that includes multiple formatting options.
VladimirAG [237]
A style is a predefined text format that includes multiple formatting options.
7 0
2 years ago
What is printed to the console?<br> console.log(15 % 4);<br><br> 1<br><br> 2<br><br> 3<br><br> 4
Radda [10]

Answer:

3

Explanation:

7 0
2 years ago
Which of the following not a hardware componet​
erma4kov [3.2K]

Answer:

antivirus.......hope this answers your question

3 0
2 years ago
Which position most commonly runs routes in order to catch a pass?.
pochemuha
The position sis she commonly dish’s sayhabwueuc. sisjeuwbwbeudus
8 0
2 years ago
Other questions:
  • Given the following code, what is output by the method call, mystery(6 * 8)?
    8·1 answer
  • Oracion con punto focal​
    6·1 answer
  • You turn your computer on and the computer will not boot up. What is something you should do to diagnose the problem?
    6·2 answers
  • What type of code do computers typically use to operate? A. CSS B. HTML 5 C. HTML D. Binary
    12·2 answers
  • Q: If a program is invoked with "python program.py -r input.dat output.dat", what are the elements of argv?
    10·1 answer
  • In java
    6·1 answer
  • What is the purpose of file extensions? A. They execute the mail merge function, B. They tell the operating system what kind of
    15·2 answers
  • Molly claims that she doesn’t have to proofread her code for typos because the interpreter will catch her mistakes for her. Is s
    10·1 answer
  • Glenda is searching airline schedules on HolApp, a mobile Web application. While browsing the application, a banner appears on t
    12·1 answer
  • Mention and discuss specific professional ethics related to augmented reality, artificial intelligence, and the internet of thin
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!