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
rjkz [21]
3 years ago
8

How I to turn this ''loop while'' in ''loop for''?

Computers and Technology
1 answer:
ruslelena [56]3 years ago
7 0

Answer:

for (var i = 0; i <20; i++)

{

var lineY = 20 + (i * 20);

line(0, lineY, 400, lineY);

}

Explanation:

To turn the loop while to for loop, you start by considering the iterating variable i and its iterating operations which are;

var i = 0; while (i < 20) and i++;

Where var i = 0; is the initializing statement

(i < 20) is the conditional statement

i++ is the increment

The next is to combine these operations to a for loop; using the following syntax: for(initializing; condition; increment){}

This gives: for(var i = 0; i<20; i++)

Hence, the full code snippet is:

<em>for (var i = 0; i <20; i++)</em>

<em>{</em>

<em>var lineY = 20 + (i * 20); </em>

<em>line(0, lineY, 400, lineY);</em>

<em>}</em>

You might be interested in
After a webcast is completed there are no files left on your computer.
astra-53 [7]
What are you askinggggggggggg

7 0
3 years ago
What is the meaning of Android
LUCKY_DIMON [66]
For technology:
<span>It is an open-source operating system used for smartphones and tablet computers.
</span><span>In science fiction:
 It is a robot with a human appearance.</span>
6 0
3 years ago
Read 2 more answers
Renee's creating a plan for her business's information system. What should she do after she determines the goals for her busines
stiks02 [169]

get organized because of the beging when she start she will want ot be nice and fresh on everything

7 0
4 years ago
The core of ___________ is the implementation of intrusion detection systems and intrusion prevention systems at entry points to
cestrela7 [59]

Answer:

sorry I can't understand what is this is

3 0
3 years ago
In the context of intentional security threats, _____ can erase data and wreak havoc on computers and networks but do not replic
mihalych1998 [28]

Answer:

The answer is "Option D".

Explanation:

Trojan program is a malicious code that is also known as a virus. It is a rootkit, that aims to infect the computer to hide or obscure an object. These programs are mainly used to download additional content, such as additional pieces of malware, to the infected computer, and other options are wrong that can be defined as follows:

  • In option A, It is not correct, this option infects the system.
  • In option B, It is used for infects another computer that's why it is incorrect.
  • In option C, It is incorrect because it is used in cybersecurity.  
5 0
3 years ago
Other questions:
  • Which option describes wearable technology?
    5·2 answers
  • What is the purpose for adding images and graphics to a web page?
    5·1 answer
  • The double equal sign (==) is used to compare values. <br>true or false​
    14·1 answer
  • What type of filtering software divides email messages that have been received into two piles, spam and non-spam and then analyz
    13·1 answer
  • A __________ search engine focuses on a specific subject.<br><br>answer : Specialized
    8·1 answer
  • When would it be most beneficial to package a presentation on a CD? Check all that apply. when sending the file via email for di
    6·2 answers
  • What’s your tiktok? if u have one
    10·2 answers
  • Today
    14·1 answer
  • Which of the following includes premium content you must pay to use?<br> On word
    6·1 answer
  • refer to the exhibit. a user pc has successfully transmitted packets to www.cisco. which ip address does the user pc target in o
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!