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

Another question on Engineering

question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:10
Carbon dioxide gas expands isotherm a turbine from 1 mpa, 500 k at 200 kpa. assuming the ideal gas model and neglecting the kinetic and potential energies, determine the change in entropy, heat transfer and work for each kilogram of co2.
Answers: 2
question
Engineering, 04.07.2019 18:20
Most leaks in reciprocating air compressors can be detected and minimized by: (clo4) a)-detecting leakage areas using ultrasonic acoustic detector. b)-tightening joints and connections c)-replacing faulty equipment d)-all of the given options
Answers: 2
question
Engineering, 04.07.2019 18:20
Have a greater impact on maintenance productivity than any other support group. (clo5) a)-the top management b)-inventory and purchasing c)-sub-contracting d)-cmms
Answers: 2
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
question
Mathematics, 08.01.2021 18:40
question
Biology, 08.01.2021 18:40
question
English, 08.01.2021 18:40
question
Mathematics, 08.01.2021 18:40
question
Mathematics, 08.01.2021 18:40
question
Mathematics, 08.01.2021 18:40
Questions on the website: 13722367