subject
Engineering, 08.11.2019 22:31 holytreesaroy

The sum of squares of n is n2 + (n-1)2 + (n-2)2 + + 12 for n> =1.write code that uses a for loop (not a while or do loop) that starts the loop counter i at n, and reduces i by 1, as long as i is > = 1, and inside the loop we accumulate i2. after the loop is done, return the accumulated value. now place this code inside a function named squaresof, which takes one parameter n as integer, and returns an integer. declare all other needed variables. note that you must write the function definition and name and use the variables (and their names) above exactly as noted. you may add other variables as needed. do not add any other code here.

ansver
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, aaliyah80
The drive force for diffusion is 7 fick's first law can be used to solve the non-steady state diffusion. a)-true b)-false
Answers: 1
image
Engineering, 04.07.2019 18:10, namira16
Which of the following controllers anticipates the future from the slope of errors over time? a)-proportional b)-on/off c)-integral d)-derivative.
Answers: 2
image
Engineering, 04.07.2019 19:10, thawkins79
Agas contained within a piston-cylinder assembly e end nation about same energy states, 1 and 2, where pi 10 bar, v undergoes two processes, a and b, between the sam 0.1 m3, ui-400 kj and p2 1 bar, v2 1.0 m2, u2 200 kj: process a: process from 1 to 2 during which the pressure- volume relation is pv constant process b: constant-volume process from state 1 to a pressure of 2 bar, followed by a linear pressure-volume process to +20 0 state 2 kinetic and potential energy effects can be ignored. for each of the processes a and b, (a) sketch the process on p-v coordinates, (b) evaluate the work, in kj, and (c) evaluate process the heat transfer, in kj
Answers: 2
image
Engineering, 04.07.2019 19:20, sashajayne8260
Determine the stoichiometric and actual air-fuel ratios and the mole flue gas composition for combustion with 15% excess air for raw indiana, pennsylvania raw coal.
Answers: 3
You know the right answer?
The sum of squares of n is n2 + (n-1)2 + (n-2)2 + + 12 for n> =1.write code that uses a for loop...

Questions in other subjects:

Konu
Mathematics, 23.10.2019 18:00
Konu
Mathematics, 23.10.2019 18:00