TRUE or FALSE The following procedure satisfies the finitene

TRUE or FALSE: The following procedure satisfies the finiteness characteristics of an algorithm.

Procedure average (a_1, a_2, ..., a_n: positive integers) sum: = 0 k: = 1 while n > 0 sum: = sum + k average: = sum/n

Solution

Finiteness – the algorithm stops after a finite number of instructions are executed.
average() is not end when n>0 , have to maintain counter in the while loop,
Answer : FALSE

TRUE or FALSE: The following procedure satisfies the finiteness characteristics of an algorithm. Procedure average (a_1, a_2, ..., a_n: positive integers) sum:

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site