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
Basile [38]
3 years ago
11

How I to turn this ''loop while'' in ''loop for''? var i = 0; while (i < 20) { var lineY = 20 + (i * 20); line(0, lineY, 400,

lineY); i++; }
Computers and Technology
1 answer:
Fudgin [204]3 years ago
5 0

Answer:

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

lineY = 20 + (i * 20);

line(0, lineY, 400, lineY) }

Explanation:

First declare and initialize the variable i. You have not specified the data type of i so if the data type of i is integer i.e. int then you should declare i variable in the for loop as for(int i = 0; i<20;i++)

So the given while loop has a variable i which is initialized to 0. Then while(i<20) means that while loop executes until the value of i exceeds 20. If this while condition is true then the two statements inside its body will execute. The two statements are: lineY = 20 + (i * 20);

line(0, lineY, 400, lineY);

The value of i ins incremented after each iteration i.e. i++

So while loop has the following syntax"

1) initialization;  ---->  i = 0

2) while(condition) {  ----> i<20

3) loop body ----->  lineY = 20 + (i * 20); line(0, lineY, 400, lineY);

4) increment or decrement loop variable  } ----> i++

For loop has the following syntax:

for( initialization of loop variable ; condition; decrement/increment loop variable)  {

loop body }

Here:

initialization  ---->  i = 0

condition        ----> i<20

loop body     -----> lineY = 20 + (i * 20); line(0, lineY, 400, lineY);

increment or decrement loop variable  ---->  i++

You might be interested in
How are the number of rows calculated.​
Eva8 [605]

Answer:

ROWS function

Explanation:

Hope this helped

6 0
2 years ago
Photography is harder with digital cameras than with film cameras.<br>true<br>false
Oliga [24]

the answer is false bc digutal is easeir




7 0
2 years ago
Read 2 more answers
Consider the following declaration.int[] alpha = new int[3];Which of the following input statements correctly input values into
stepladder [879]

Answer:

Option (2) i.e., Only (ii) is the correct option to the following question.

Explanation:

Here, in the following code that is written in the Java Programming Language in which they set integer data type array variable "alpha" and set its index to 3 through "new" keyword then, we get input from the user in the index 0 then, we get input from the user in the index 1 then, again we repeat this step for index 2. So, that's why the following option is correct.

Option 1 is wrong because in this option the user input only in the index 0 and this is also the wrong way to insert value in the array variable.

5 0
3 years ago
The 6 steps for PowerPoint competency from the TED talk in the module "How to Avoid Death by PowerPoint."?
KIM [24]

Answer:

1. Do some presentation preparation work

2. Set the right tone and end on a high note.

3. Create sleek and stylish slides.

4. Get your audience to focus.

5. Its all about you.

Explanation:

1. Do some presentation preparation work:

A good presentation begins, not with slides, but with a pencil and paper. Research your audience’s background, interests and capabilities. What do they already know, for instance, and what can they learn from you?

2. Set the right tone and end on a high note:

You have no more than 30 seconds to secure your audience’s attention. So, what attention-grabbing opener will you use?

Visual communications expert Curtis Newbold suggests “a fascinating quote; an alarming or surprising statistic; asking your audience a question; telling a relevant and funny joke… an imaginary scenario; or a demonstration''.

3. Create sleek and stylish slides:

Once you have your story down, you can start to design your slides.  

Before you do, it’s important to think about the practicalities. Will they, for instance, be displayed Widescreen with a 16:9 ratio? Or Standard with 4:3? This might seem like a small detail, but it can make a huge difference in terms of visual impact.

4.  Get your audience to focus:

The most important thing is to grab your audience’s attention straight away – and then maintain it! You want your audience to go away having learned something. So, make it as easy as possible for people to grasp your message “from the off”!

5.  Its all about you:

Finally, remember that, ultimately, it’s you that the audience should be paying attention to, not your slides!

PowerPoint can be used to create great visual aids, but the success of your presentation is determined by the way you deliver them. So, tell your story with a confident, compelling physical presence, and master it by rehearsing it 10 to 15 times.

6 0
3 years ago
The Warn-on-Forecast has been developed by the National Weather Service to help predict hazardous weather earlier. Which of the
allsm [11]

Answer:

Federal agencies will be able to disseminate information to large local communitie

Explanation:

the headquarter of National weather service is responsible for to coordinate weather related warnings to organisations to ensure compatibility and effectiveness of weather services and provide  public protection and safety.

National Weather service entered in the new erra of innovation with use of technology they will be able to disseminate information to large local communitie

5 0
3 years ago
Read 2 more answers
Other questions:
  • During an interview, your non-verbal communication (body language, gestures, tone of voice, speed of talking,
    6·1 answer
  • Given a int variable named yesCount and another int variable named noCount and an int variable named response write the necessar
    6·1 answer
  • Which command button contains the following sub options as given in the picture?
    6·2 answers
  • Given two variables, is Empty of type boolean, indicating whether a class roster is empty or not, and number Of Credits of type
    10·1 answer
  • When you ____ an exception, you send a message that an error has occurred to another part of the program.
    7·2 answers
  • 3.6 Code Practice Edhesive. (PYTHON LANGUAGE)
    13·1 answer
  • The post-closing trial balance shows the balances of only the ____ accounts at the end of the period.
    12·1 answer
  • What does the top level domain in a url inducate? A. The organization or company that owns the website. B. The organization or c
    6·2 answers
  • Zara wants to create some lines of code that are ignored by the computer. What should these lines begin with?
    5·1 answer
  • Write its features:features of computer ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!