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
Bond [772]
3 years ago
11

Write an enhanced for loop that multiplies all elements in an int[] array named factors, accumulating the result in a variable n

amed product. Numbers.java 123456789101112 public class Numbers{ public int multiply(int[] factors) { int product
Computers and Technology
1 answer:
IgorC [24]3 years ago
8 0

public class Numbers {

   public int multiply(int[] factors){

       int product = 1;

       for (int i : factors){

           product *= i;

       }

       return product;

   }

   public static void main(String[] args) {

       int [] factors = {1,2,3,4,5,6,7,8,9,10,11,12};

       Numbers num = new Numbers();

       System.out.println(num.multiply(factors));

   }

   

}

I hope this helps!

You might be interested in
The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound. 1. Declare a const named CENTS_PER_POUND and initi
viva [34]

Answer:

Replace /* Your solution goes here */

with

<em>const int CENTS_PER_POUND = 25; </em>

<em> cout << "Weight(lb): "; </em>

<em>cin >> shipWeightPounds; </em>

<em>shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds; </em>

<em />

Explanation:

This line declares and initializes CENTS_PER_POUND as constant integer to 25

const int CENTS_PER_POUND = 25;

This line prompts user for weight of shipment

cout << "Weight(lb): ";

This line gets weight from the user

cin >> shipWeightPounds;

This line calculates the cost of shipment

shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;

4 0
3 years ago
Which reading strategy refers to reading only the key words and phrases?
kirill [66]
I think the answer is scanning.
6 0
4 years ago
Read 2 more answers
The number of bits that can be transferred per second over a given transmission medium.
Fantom [35]

Answer:

As the term implies, the speed in bps is equal to the number of bits transmitted or received each second. Larger units are sometimes used to denote high data speeds. One kilobit per second (abbreviated Kbps in the U.S.; kbps elsewhere) is equal to 1,000 bps.

3 0
3 years ago
A ________ is a material deficiency, or combination of significant deficiencies, that results in more than a remote likelihood t
VLD [36.1K]

Answer:

a.material control failure

Explanation:

A material control failure is a material deficiency, or combination of significant deficiencies, that results in more than a remote likelihood that a material mis-statement in the annual or interim financial statements will not be prevented or detected.

7 0
4 years ago
What are the methods of gilding<br><br>nonsense will be immediately reported. ​
Luden [163]
Methods of gilding include hand application and gluing, typically of gold leaf, chemical gilding, and electroplating, the last also called gold plating. Parcel-gilt (partial gil) objects are only gilded over part of their surfaces.
6 0
2 years ago
Other questions:
  • Which of the following is not considered as part of technology literacy?
    8·1 answer
  • Which aperture setting will give the shallowest depth of field?
    10·2 answers
  • The exercise instructions here are long -- please read them all carefully. If you see an internal scrollbar to the right of thes
    15·1 answer
  • Which of the following Internet protocols is used to request and send pages and files on the World Wide Web?
    15·1 answer
  • i set up an account and paid the yearly fee, now it's asking me to join. i've tried to log in and brainly isn't accepting my ema
    8·1 answer
  • What correctly describes the features of the service called kickstarter?
    14·2 answers
  • How do you change your grade level
    10·1 answer
  • Kylee needs to ensure that if a particular client sends her an email while she is on vacation, the email is forwarded to a
    5·1 answer
  • Lab 8-1: Working with Boot Loader and Runlevels what is the root password
    9·1 answer
  • By the mid-1990s, how did revenue generated from video games compare to revenue generated from movies?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!