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
garri49 [273]
3 years ago
15

Write definitions for the following two functions:______

Engineering
1 answer:
lawyer [7]3 years ago
6 0

Answer:

<em>Written in Python</em>

def SumN(n):

     total = 0

     for i in range(1,n+1):

           total = total + i

     print("Total: ",total)

def SumNCubes(n):

     total = 0

     for i in range(1,n+1):

           total = total + i**3

     print("Cube: ",total)

n = int(input("User Input: "))

if n > 0:

     SumN(n)

     SumNCubes(n)

Explanation:

The SumN function is defined here

def SumN(n):

This line initializes the total to 0

     total = 0

The following iteration compute the required sum

<em>      for i in range(1,n+1): </em>

<em>            total = total + i </em>

This line outputs the calculated sum

     print("Total: ",total)

The SumNCubes function is defined here

def SumNCubes(n):

This line initializes the total to 0

     total = 0

The following iteration compute the required sum of cubes

<em>      for i in range(1,n+1): </em>

<em>            total = total + i**3 </em>

This line outputs the calculated sum of cubes

     print("Cube: ",total)

The main starts here; The first line prompts user for input

n = int(input("User Input: "))

The next line checks if input is greater than 0; If yes, the two defined functions are called

if n > 0:

     SumN(n)

     SumNCubes(n)

You might be interested in
What is Applied Science?​
andreev551 [17]

Answer:

Applied science is the application of existing scientific knowledge to practical applications, like technology or inventions. Within natural science, disciplines that are basic science develop basic information to predict and perhaps explain and understand phenomena in the natural world.

6 0
3 years ago
A photovoltaic panel of dimension 2m×4m is installed on the
blsea [12.9K]

Answer:

Explanation:

Simply put, a solar panel works by allowing photons, or particles of light, to knock electrons free from atoms, generating a flow of electricity. Solar panels actually comprise many, smaller units called photovoltaic cells. (Photovoltaic simply means they convert sunlight into electricity. The attached diagram give an ilustsration of the photovotaic pannel mounted on a roof top.

Solution

To Determine the electric power generated for

a) A still summer day.

E = A * r * H * PR

E = Total Amount of Energy in kilowatt

A = Total Surface Area

r = efficiency Rating

H = global radiation value

PR = Performance Ratio

kwh = watt * Time/1000

kwh = 100 * 35/1000

3.5

b)

kwh = watt * Time/1000

kwh = 30 *15/1000

4.5

6 0
3 years ago
What is programming and sensory?
NNADVOKAT [17]

Answer:

Programing is using data or codes to make something happen A sensory is like when you move your arm in front of a device and like it has a light that turns on then that is sensory it like can tell your moving

7 0
3 years ago
The water level in a tank is 20 m above the ground. A hose is connected to the bottom of the tank, and the nozzle at the end of
weeeeeb [17]

Answer:

P_{pump}= 68600Pa

Explanation:

We understand that the sum of the pressures in the tank and the pump is equal to that of the Nozzle,

In this way,

P_{tank} + P_{pump} = P_{nozzle}

For the pressure we also know that it is given by

P=\rho gh

\rho gh_1 + P_{pump} = \rho gh_2

So,

P_{pump} = \rho g(h2 - h1)

P_{pump}= 1000*9.8(27-20)

P_{pump}= 68600Pa

7 0
3 years ago
Suggest how the following requirements might be rewritten in a
Alchen [17]

Answer:

answer letter c

Explanation:

yun anserr hhehehe

7 0
3 years ago
Other questions:
  • A strain gauge with a nominal resistance of 116 ohms is subjected to an axial strain of 4.8 millistrain. (1 millistrain= 1E-3 in
    12·1 answer
  • Steam enters an adiabatic nozzle at l MPa, 260 C, 30 m/s and exits at 0.3 MPa and 160 'C. Calculate the velocity at the exit.
    13·1 answer
  • How do u charge ur phone? :)
    11·2 answers
  • Check pics to help me out on a pennfoster exam. Will mark brainliest if I pass the test. Thanks a lot.
    7·1 answer
  • A spherical seed of 1 cm diameter is buried at a depth of 1 cm inside soil (thermal conductivity of 1 Wm-1K-1) in a sufficiently
    14·1 answer
  • 6. What living area room must be adjacent to the kitchen?
    14·1 answer
  • A 400 kg machine is placed at the mid-span of a 3.2-m simply supported steel (E = 200 x 10^9 N/m^2) beam. The machine is observe
    14·1 answer
  • An offshore oil rig will drill into the ocean floor which is located 1 mile below the water surface. Determine the pressure at t
    11·1 answer
  • What is a height gage?
    14·1 answer
  • Sarah and Raj take/takes me to a baseball game every year.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!