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
Kisachek [45]
2 years ago
6

Identify examples of loop structures using comments in your code. Be sure your examples address each of the following: i. Item-b

ased for loops ii. Index-based (range) for loops ii. While loops
Computers and Technology
1 answer:
Alex73 [517]2 years ago
4 0

Answer:

item based for loop is used to iterate items in a collection .it is useful to apply some operations on item. Index based for loop is used to execute some logic repetitively. While loop also useful to execute a logic repetitively

Explanation:

item based for loop is used to iterate items in a collection .it is useful to apply some operations on item. Index based for loop is used to execute some logic repetitively. While loop also useful to execute a logic repetitively

in c#.net , following example explains this

using system;

void main(){

String[] names=new  names[20];

int counter=0;

//index based for loop

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

console.read(names[i]);

}

//item based for loop

foreach(string s in names){

console.writeline(s);

}

//while loop

while(counter<20)

{

console.read(names[counter];

counter++;

}

}

You might be interested in
what evidence supports the claims that the Taj Mahal is a symbol of historical and cultural glory as well as an architectural ma
belka [17]

Answer:

Taj Mahal

Explanation:

The Taj Mahal is best described in the book; World Wonders Worn Down by Cody Crane.

Go to Page 14 of the attached pdf document and you'd find the write up by Jeffery Batholet.

Cheers

Download pdf
8 0
3 years ago
Java code?????
12345 [234]

Answer:

Explanation:

Here is the code for you:

import java.io.*;

import java.util.*;

class GirlScoutCookies

{

public static void main(String[] args)

{

int [] BoxesCategory = new int[5];

Scanner sc = new Scanner(System.in);

System.out.print("Total number of girls in the troop: ");

int numOfGirlScouts = sc.nextInt();

for(int i = 0; i < numOfGirlScouts; i++)

{

System.out.print("Boxes of cookies for girl #"+(i+1)+": ");

int boxes = sc.nextInt();

if(boxes >= 0 && boxes <= 10)

BoxesCategory[0]++;

else if(boxes >= 11 && boxes <= 20)

BoxesCategory[1]++;

else if(boxes >= 21 && boxes <= 30)

BoxesCategory[2]++;

else if(boxes >= 31 && boxes <= 40)

BoxesCategory[3]++;

else if(boxes > 40)

BoxesCategory[4]++;

}

System.out.println("TOTAL BOXES\tNUMBER OF GIRL SCOUTS");

System.out.println(" 0 to 10\t"+BoxesCategory[0]);

System.out.println("11 to 20\t"+BoxesCategory[1]);

System.out.println("21 to 30\t"+BoxesCategory[2]);

System.out.println("31 to 40\t"+BoxesCategory[3]);

System.out.println("41 or more\t"+BoxesCategory[4]);

}

}

And the sample output is:

5 0
3 years ago
Write a loop that inputs words until the user enters STOP. After each input, the program should number each entry and print in t
vekshin1

I hope this helps you.

3 0
3 years ago
An index purports to speed data retrieval. you, therefore, index every attribute in each table. select the likely consequence.
stira [4]

Answer:

b. data entry slows as every INSERT , UPDATE, or DELETE statement must also update every index.

Explanation:

This process help to improve the speed of get data , it takes each element in the indexed column and save the location to get faster the data. But if you index every attribute in a table it going to take a lot of time locating each column in the respective index in each query(update, delete and insert). For that reason is necesary be carefull with this process and only put index in the relevant columns

4 0
3 years ago
Windows Rights Management Services is used in conjunction with which Microsoft applications?
Mariana [72]
“Word” is your answer
6 0
2 years ago
Other questions:
  • Web design people please help!
    7·1 answer
  • Read the scenario, and then answer the question that follows.
    10·1 answer
  • Displays are geared for a specific resolution. what is this resolution called?
    15·1 answer
  • What safety feature melts to protect a circuit? a. fuse b. diode c. three-prong plug d. transistor
    10·2 answers
  • Operating systems provide a measure of security by allowing users to access to those resources they've been cleared to use as we
    8·1 answer
  • The federal government is the largest employer of cybersecurity professionals true or false
    5·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • What is polymerization1​
    11·1 answer
  • Data type can only be true or false <br><br> Answer: Bool
    15·1 answer
  • TO Cloud
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!