Write a class Repetitive, with an array rep, with 7 Integer values. The class should set all values in the array to 15, using a for-loop.
Write the class RepetitiveWithoutFor, doing the same thing as Repetitive above, though not using a for-loop.
This time write a class Repeat, with an array repeater containing 4 Real values. The values in the array shall be set to 1, 4, 7, 10, using a for-loop.
Write a function, Rapper, which calculates the sum of the values in the array.
Write an instance, where the values of that array shall be set. Then simulate the instance class and plot the result.
Why is it better not to have the same name on the variable in the iteration expression as a variable inside the for-clause in an equation?
It is not good from the programmers point of view. The variable inside the for-clause is hidden, which is all right, but they are by the programmer easily mixed together.