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
trapecia [35]
4 years ago
10

The enhanced for statement allows you to iterate through the elements of an array or a collection without using a counter. Give

an example. Notice: The enhanced for statement cannot be used to modify elements in an array. If a program needs to modify elements, use the traditional counter-controlled for statement.

Computers and Technology
2 answers:
Vilka [71]4 years ago
8 0

Answer:

See explaination

Explanation:

public class EnhancedForExample

{

public static void main(String[] args) {

int[] arr = {3, 5, 9, 4, 5, 9};

for(int num : arr) {

System.out.println(num);

}

}

lesya [120]4 years ago
7 0

Answer:

Check the explanation

Explanation:

public class EnhancedForExample {

   public static void main(String[] args) {

       int[] arr = {4, 2, 9, 1, 5, 7};

       for(int num : arr) {

           System.out.println(num);

       }

   }

}

Kindly check the attached image below for the code output.

You might be interested in
create a list of numbers 0 through 40 and assign this list to the variable numbers. then, accumulate the total of the list’s val
gogolik [260]

Using the knowledge in computational language in python it is possible to write a code that create a list of numbers 0 through 40 and assign this list to the variable numbers.

<h3>Writting the code:</h3>

<em>numbers=list(range(53));</em>

<em>print(numbers);</em>

<em>str1 = "I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living."</em>

<em>numbs=sum(map(lambda x:1, str1))</em>

<em>print(numbs);</em>

<em>numbers=list(range(41));</em>

<em>sum1=sum(numbers);</em>

<em>print(sum1);</em>

See more about python at brainly.com/question/18502436

#SPJ1

5 0
2 years ago
Components Of Desktop System?<br><br><br><br><br><br><br>Thanku! :)<img src="https://tex.z-dn.net/?f=%20%5C%3A%20" id="TexFormul
trapecia [35]

components Of desktop system:

  • motherboard { backbone of the computer system controlling all tasks }
  • RAM { temporary random access memory }
  • ROM { stores huge amount of data ex - photos, videos }
  • CPU { central processing unit which processes data }
  • GPU {graphical processing unit for video editing, 3D graphics rendering}
6 0
3 years ago
les agrees to install a new hard drive and software on marilee's computer in exchange for four of her used textbooks. after he i
WARRIOR [948]

Marilee can sue for breach of contract, because Les had a preexisting duty to do all of the work.

What is hard drive ?

The physical device that houses all of your digital stuff is a hard disk. Digital stuff that is kept on a hard drive includes your papers, photos, music, videos, applications, application preferences, and operating system. There are internal and external hard drives.

What is software?

Software is a collection of instructions, data, or computer programs that are used to run machines and carry out particular activities. It is the antithesis of hardware, which refers to a computer's external components. A device's running programs, scripts, and applications are collectively referred to as "software" in this context.

What does running program means?

Double-click the executable file or the shortcut icon pointing to the executable file on Windows to start the program. If you find it difficult to double-click an icon, you can highlight it by clicking it once and then using the Enter key on the keyboard.

Learn more about hardware and software click here:

brainly.com/question/24231393

#SPJ4

8 0
1 year ago
Discuss a situation in which you might want to use a floating-point number with a fractional part for a loop control variable. W
serious [3.7K]

Answer:

1. When calculating the division of each number in some range of floating type number.

2. One cannot use real numbers for exact comparison. Two real numbers are rarely equal. Real numbers are have representational errors.

Explanation:

1. In structured programming, we make use of a floating-point number with a fractional part for a loop control variable. a given scenario is when we just want to calculate the division of each number in some range of floating type number. However, the downsides to using a floating-point number with a fractional part for a loop control variable are:

  • They can cause 'off-by-one' failure
  • A floating point number cannot represent all simple fractions exactly

2. The pitfalls of using real numbers for the index variable in a for loop:

  • Two real numbers are hardly equal
  • One cannot use real numbers for exact comparison
  • The existence of representational errors
7 0
3 years ago
Again, suppose that n and r denote integer values where r &gt; 0 and n ≥ 0. What are two "simple" values, say lowEnough and tooH
enyata [817]

Answer:

Answer explained

Explanation:

From the previous question we know that while searching for n^(1/r) we don't have to look for guesses less than 0 and greater than n. Because for less than 0 it will be an imaginary number and for rth root of a non negative number can never be greater than itself. Hence lowEnough = 0 and tooHigh = n.

we need to find 5th root of 47226. The computation of root is costlier than computing power of a number. Therefore, we will look for a number whose 5th power is 47226. lowEnough = 0 and tooHigh = 47226 + 1. Question that should be asked on each step would be "Is 5th power of number < 47227?" we will stop when we find a number whose 5th power is 47226.

6 0
3 years ago
Other questions:
  • QoS services are protocols that allow routers to make decisions about which IP datagram may be more important than others. Which
    13·1 answer
  • What is required to display content on transparencies?
    6·1 answer
  • Which of the following is true? A)Checks and Debit Cards both withdraw money directly from a bank account. B)Checks are the most
    13·2 answers
  • How do i cancle my account on brainly
    11·1 answer
  • Evan is borrowing a friend's laptop to check out some groovy music files. What can Evan look for to quickly identify
    6·1 answer
  • A computer ____ is the amount of data (typically measured in bits or bytes) that a cpu can manipulate at one time.
    8·1 answer
  • Nielsen purchases scanner data from retail transactions to track the sales of consumer packaged goods, gathered at the point of
    14·1 answer
  • You can use this area to create your resume.
    12·1 answer
  • Which of these statements regarding mobile games is true? A. They are typically played indoors. B. They have detailed environmen
    15·2 answers
  • The __________ was the first all electronic computer.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!