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
alexgriva [62]
3 years ago
14

Write a function called arraySum() that takes two arguments: an integer array and the number of elements in the array. Have the

function return as its result the sum of the elements in the array
Engineering
1 answer:
Oduvanchick [21]3 years ago
5 0

Answer:

//Function is written using C++ Programming Language

// Comments are used for explanatory purpose

// The main method is not included

using namespace std;

// Declare arraySum with two arguments. The first represents the array name while the other

// Represents the number of elements

int arraySum(int arr[], int n)

{

int total = 0; // declare and Initialise total to 0

// Iterate through the array to calculate sum

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

total += arr[i];

}

return total;

}

You might be interested in
A thick steel slab ( 7800 kg/m3, 480 J/kg·K, 50 W/m·K) is initially at 300°C and is cooled by water jets impinging on one of its
AleksandrR [38]

Answer: 67.392s

Explanation: detailed calculation is shown below

4 0
3 years ago
Read 2 more answers
Steam at 1400 kPa and 350°C [state 1] enters a turbine through a pipe that is 8 cm in diameter, at a mass flow rate of 0.1 kg⋅s−
sergeinik [125]

Answer:

Power output, P_{out} = 178.56 kW

Given:

Pressure of steam, P = 1400 kPa

Temperature of steam, T = 350^{\circ}C

Diameter of pipe, d = 8 cm = 0.08 m

Mass flow rate, \dot{m} = 0.1 kg.s^{- 1}

Diameter of exhaust pipe, d_{h} = 15 cm = 0.15 m

Pressure at exhaust, P' = 50 kPa

temperature, T' =  100^{\circ}C

Solution:

Now, calculation of the velocity of fluid at state 1 inlet:

\dot{m} = \frac{Av_{i}}{V_{1}}

0.1 = \frac{\frac{\pi d^{2}}{4}v_{i}}{0.2004}

0.1 = \frac{\frac{\pi 0.08^{2}}{4}v_{i}}{0.2004}

v_{i} = 3.986 m/s

Now, eqn for compressible fluid:

\rho_{1}v_{i}A_{1} = \rho_{2}v_{e}A_{2}

Now,

\frac{A_{1}v_{i}}{V_{1}} = \frac{A_{2}v_{e}}{V_{2}}

\frac{\frac{\pi d_{i}^{2}}{4}v_{i}}{V_{1}} = \frac{\frac{\pi d_{e}^{2}}{4}v_{e}}{V_{2}}

\frac{\frac{\pi \times 0.08^{2}}{4}\times 3.986}{0.2004} = \frac{\frac{\pi 0.15^{2}}{4}v_{e}}{3.418}

v_{e} = 19.33 m/s

Now, the power output can be calculated from the energy balance eqn:

P_{out} = -\dot{m}W_{s}

P_{out} = -\dot{m}(H_{2} - H_{1}) + \frac{v_{e}^{2} - v_{i}^{2}}{2}

P_{out} = - 0.1(3.4181 - 0.2004) + \frac{19.33^{2} - 3.986^{2}}{2} = 178.56 kW

4 0
2 years ago
The town of Mustang, TX is concerned that waste heat discharged from a new up- stream power plant will decimate the minnow popul
vitfil [10]

Answer:

Yes the water will be safe at the point of cooling water discharge

Explanation:

Power losses in plant= 350- 350×0.35=227.5MW

Rate of heat rejection to stream= 0.75× 227.5= 170.625MW

Rate of heat rejection= rate of flow of water× c × ΔT

170625000= 150000000× 4.186 × (Final temperature- 20)

Final temperature= 20.3 ◦C

The final temperature of stream will be 20.3 ◦C. Thechange is very small so the minnows will be able to handle this temperature.

7 0
3 years ago
To prevent drainage of the transmission fluid from the converter when the
-BARSIC- [3]
Answer
D I think
Explanation
4 0
2 years ago
To provide some perspective on the dimensions of atomic defects, consider a metal specimen that has a dislocation density of 105
GenaCL600 [577]

Answer:

62.14\ \text{miles}

6213727.37\ \text{miles}

Explanation:

The distance of the chain would be the product of the dislocation density and the volume of the metal.

Dislocation density = 10^5\ \text{mm}^{-2}

Volume of the metal = 1000\ \text{mm}^3

10^5\times 1000=10^8\ \text{mm}\\ =10^5\ \text{m}

1\ \text{mile}=1609.34\ \text{m}

\dfrac{10^5}{1609.34}=62.14\ \text{miles}

The chain would extend 62.14\ \text{miles}

Dislocation density = 10^{10}\ \text{mm}^{-2}

Volume of the metal = 1000\ \text{mm}^3

10^{10}\times 1000=10^{13}\ \text{mm}\\ =10^{10}\ \text{m}

\dfrac{10^{10}}{1609.34}=6213727.37\ \text{miles}

The chain would extend 6213727.37\ \text{miles}

3 0
3 years ago
Other questions:
  • Practicing new things strains your brain fibers, weakening your ability to make connections.
    13·1 answer
  • A turbine produces shaft power from a gas that enters the turbine with a (static) temperature of 628 K, a velocity of 143 m/s an
    7·1 answer
  • The market for college textbooks is illustrated in the graph below. In the market for textbooks, the current price of a textbook
    11·1 answer
  • Which of the following is an example of seeking accreditation?
    7·1 answer
  • Air at 2.5 bar, 400 K is extracted from a main jet engine compressor for cabin cooling. The extracted air enters a heat exchange
    14·2 answers
  • Zionjasean17 zionjasean17
    8·2 answers
  • Four subjects civil engineers need to study​
    12·1 answer
  • 30 points have a good day
    11·1 answer
  • An ideal gas is contained in a closed assembly with an initial pressure and temperature of
    14·1 answer
  • 4.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!