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
Sketch the velocity profile for laminar and turbulent flow.
Margarita [4]

Answer:

The laminar flow is generally given in high viscosity fluids such as honey or oil, it has the characteristic of flowing in an orderly manner, the walls of the tube have a zero speed while in the center it has a maximum speed.

turbulent flow is characterized by fluid velocity vectors presenting themselves in a disorderly manner and in all directions.

I attached the drawings for the velocity profile in laminar and turbulent flow.

4 0
3 years ago
# line 1 age = int(input("Enter your age: ")) # line 3 print("Invalid input") If we want the computer to display "Invalid input"
user100 [1]

Answer:

Insert

'try:' at line 1

'except:' at line 3

Explanation:

The "try and except" commands in Python are used for exception handling.

try: the statements under this block are executed normally

except: the the statements under this block are executed when there is an exception.

We can use these commands to handle errors, for example, in the given scenario we don't want the user to enter a floating point number such as

1.5, 2.6 etc.

When the user enters an integer number then the except command is not executed.

When the user enters a floating point number then the except command is executed, program is stopped and error message is shown that is at line 4

Python code:  

# line 1

try:

# line 2

   age = int(input("Enter your age: "))

# line 3

except:

# line 4

   print("Invalid input")

Output:

Test 1:

Enter your age: 20

Test 2:

Enter your age: 20.5

Invalid input

5 0
3 years ago
Show that -40 F is approximately equal to -40 C.
V125BC [204]

Answer: Please see below the explanation.

Explanation:

The Celsius (ºC) and Farenheit (ºF), are different temperature scales, but both have identifiable values for two important physical phenomena, water freezing point and water boiling point.

For º C, these are follows:

Freezing Point= 0º C            Boiling Point: 100ºC

For º F, we have the following:

Freezing Point= 32º F            Boiling Point: 212 ºF

Assuming that all steps (in each scale) between two following values are equal, we have 100 º C between both points in ºC, and 190º in ºF, so degrees in Farenheit are "shorter" than in Celsius, being the relationship, approximately the following:

1 º C = 9/5 ºF.

Taking into account that, by definition, 0ºC = 32º F, we can use the following equations in order to convert ºC to ºF, and viceversa:

ºC = (ºF-32) 5/9    

ºF = 32 + 9/5ºC

Now, let's calculate -40ºF, in ºC:

ºC= (-40-32)* 5/9 = -40º C

Let's do the same, converting -40ºC to ºF:

ºF = 32 + (-40)*9/5 = 32 + (-72) = -40ºF.

8 0
3 years ago
Multimeter and the LCD is showing Hz. What's she measuring?
eimsori [14]

Answer:

i think its d frequency

Explanation:

hz on a multimeter means frequency setting

6 0
3 years ago
Write down the types of the Hydraulic Cylinders?
nirvana33 [79]

Answer:

There are following type of hydraulic cylinders

1.Single acting

2.Double acting

3.Single acting spring loaded

4.Non differential type

5.Ram type

6.Piston type

7.Actuating type

8.Telescopic type

4 0
4 years ago
Other questions:
  • The human circulatory system consists of a complex branching pipe network ranging in diameter from
    10·1 answer
  • A cylindrical rod of 1040 Steel originally 10.5 mm in diameter is to be cold worked by drawing to a final diameter of 8.5 mm. Th
    10·1 answer
  • Name one challenge for engineering managers wanting to implement the concurrent engineering concept
    12·1 answer
  • Given the system of equations−3x2+7x3=2,x1+2x2–x3=3,5x1−2x2=2(a). Compute the determinant. (b). Use Cramer’s rule to solve for t
    6·1 answer
  • What is one economic effect of environmental-protection laws?
    7·2 answers
  • What are the pros and cons of cooking with each type of heat source (solar vs fossil fuel)
    13·1 answer
  • because the United States is linked to producers distributors and consumers in other countries it is described as participating
    7·1 answer
  • A solid steel shaft ABCDE turns freely in bearings at points A and E. The shaft is driven by the gear at C, which applies a torq
    14·1 answer
  • What is the best way to cut a taper
    5·2 answers
  • Damage reports should contain the information needed for what?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!