Software technologicalfaults We want to develop a program wh ich calculates and prints the sum of the

Question:

Software technologicalfaults We want to develop a program wh ich calculates and prints the sum of the fIoat numbers (1.0/ fIoat (l)), for 1 varying from 1 to a given value N. The following algorithm performs such calculus:

procedure Serie (N ; in integer) is Surn ; float ;= 0.0;

begin for I in 1 .. N loop Surn ; = Surn + (1 . 0 / float (I)) ;

end loop ;

Print (Surn);

end Serie;

Then, execute this pro gram for different increasing values of N. Y ou may conc1ude that the series L 111, I = 1, N is convergent. This conc1usion is mathematically wrong. So, your program fails . Where is the fault?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: