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
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?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
