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]
2 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]2 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
Suppose that the time (in hours) required to repair a machine is an exponentially distributed random variable with parameter ???
Andrej [43]

We need to define the variables,

So,

F_x (x) = 1-e^{-\lambda x}\\F_x (x) = 1-e^{-0.5x}

Therefore, the probability that the repair time is more than 4 horus can be calculate as,

P(x>4)=1-P(x4)= 1-F_x(4)\\P(x>4) = 1-e^{-0.5*4}\\P(x>4) = 1-0.98\\P(x>4) = 0.018

The probability that the repair time is more than 4 hours is 0.136

b) The probability that repair time is at least 12 hours given that the repair time is more than 7 hoirs is calculated as,

P(x\geq 12|x>7)=P(X\geq7+5|x>7)\\P(x\geq12|x>7)=P(X\geq5)\\P(x\geq12|x>7)=1-P(x\leq 5)\\P(x\geq12|x>7)=1-e^{-0.5(2)}

P(x\geq 12|x>7)=0.6321

The probability that repair time is at least 12 hours given that the repair time is more than 7 hours is 0.63

3 0
3 years ago
Intravenous infusions are usually driven by gravity by hanging the bottle at a sufficient height to counteract the blood pressur
Bingel [31]

Answer:

(a) BP = 11.99 KPa

(b) h = 2 m

Explanation:

(a)

Since, the fluid pressure and blood pressure balance each other. Therefore:

BP = ρgh

where,

BP = Blood Pressure

ρ = density of fluid = 1020 kg/m³

g = acceleration due to gravity = 9.8 m/s²

h = height of fluid = 1.2 m

Therefore,

BP = (1020 kg/m³)(9.8 m/s²)(1.2 m)

<u>BP = 11995.2 Pa = 11.99 KPa</u>

(b)

Again using the equation:

P = ρgh

with data:

P = Gauge Pressure = 20 KPa = 20000 Pa

ρ = density of fluid = 1020 kg/m³

g = acceleration due to gravity = 9.8 m/s²

h = height of fluid = ?

Therefore,

20000 Pa = (1020 kg/m³)(9.8 m/s²)h

<u>h = 2 m</u>

7 0
3 years ago
All of these are uses of microwaves except...
Talja [164]

Answer:D

Explanation:

5 0
3 years ago
Situation: Peter is designing a new hybrid car that functions on solar power. He is currently working on sketches of his design
givi [52]

Answer:

whats the question?

Explanation:

8 0
2 years ago
Steam enters a turbine at 8000 kPa, 440oC. At the exit, the pressure and quality are 150 kPa and 0.19, respectively.
levacccp [35]

Answer:

\dot W_{out} = 3863.98\,kW

Explanation:

The turbine at steady-state is modelled after the First Law of Thermodynamics:

-\dot Q_{out} -\dot W_{out} + \dot m \cdot (h_{in}-h_{out}) = 0

The specific enthalpies at inlet and outlet are, respectively:

Inlet (Superheated Steam)

h_{in} = 3353.1\,\frac{kJ}{kg}

Outlet (Liquid-Vapor Mixture)

h_{out} = 890.1\,\frac{kJ}{kg}

The power produced by the turbine is:

\dot W_{out}=-\dot Q_{out} + \dot m \cdot (h_{in}-h_{out})

\dot W_{out} = -2.93\,kW + (1.57\,\frac{kg}{s} )\cdot (3353.1\,\frac{kJ}{kg} - 890.1\,\frac{kJ}{kg} )

\dot W_{out} = 3863.98\,kW

8 0
3 years ago
Other questions:
  • The following laboratory tests are performed on aggregate samples:a. Specific gravity and absorptionb. Soundnessc. Sieve analysi
    13·1 answer
  • You read a research study that concludes that the higher a student's self-esteem, the better he performs in school. This sort of
    5·1 answer
  • Early American rockets used an RC circuit to set the time for the rocket to begin re-entry after launch (true story). Assume the
    5·1 answer
  • A torsion member has an elliptical cross section with major and minor dimensions of 50.0 mm and 30.0 mm, respectively. The yield
    10·1 answer
  • The use of zeroes after a decimal point are an indicator of accuracy. a)True b)- False
    7·1 answer
  • What ic engine for mechanic
    15·1 answer
  • What are the environmental factors that cause the formation of rust?
    7·1 answer
  • What building codes did Mega Corporation fail to follow?
    9·1 answer
  • An ideal Rankine cycle with reheat uses water as the working fluid. The conditions at the inlet to the first-stage turbine are p
    12·1 answer
  • All of these are true about a magnesium part EXCEPT that it:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!