subject
Engineering, 07.04.2020 18:40 remomy05

Write a function sumsteps2 that calculates and returns the sum of 1 to n in steps of 2, where n is an argument passed to the function. For example, if 11 is passed, it will return 1 + 3+5+7+9+11. Do this using a for loop. Calling the function will look like this: >> sumsteps2(11) ans 36 For example: Test assert (sumsteps2 (11) = 36) assert (sumsteps2 (23) 144) assert ( sumsteps2(57) = 841) assert(sumsteps2(3)4) assert (sumsteps2(1001) 251001)

ansver
Answers: 3

Another question on Engineering

question
Engineering, 03.07.2019 15:10
Two flowing streams of argon gas are adiabatically mixed to form a single flow/stream. one stream is 1.5 kg/s at 400 kpa and 200 c while the second stream is 2kg/s at 500 kpa and 100 ? . it is stated that the exit state of the mixed single flow of argon gas is 150 c and 300 kpa. assuming there is no work output or input during the mixing process, does this process violate either the first or the second law or both? explain and state all your assumptions.
Answers: 1
question
Engineering, 04.07.2019 18:20
For a gate width of 2 m into the paper, determine the force required to hold the gate abc at its location.
Answers: 1
question
Engineering, 04.07.2019 18:20
Apiston-cylinder device contains 0.1 m3 of liquid water and 0.9 m3 of water vapor in equilibrium at 800 kpa. heat is transferred at constant pressure until the temperature of water reaches 350 °c. determine (a) the quality of water at the initial state (b) the work associated with this process, (c) the heat associated with this process.
Answers: 2
question
Engineering, 04.07.2019 19:10
What is creep? what is stress relaxation?
Answers: 1
You know the right answer?
Write a function sumsteps2 that calculates and returns the sum of 1 to n in steps of 2, where n is a...
Questions
question
Mathematics, 11.12.2020 01:00