Input: Positive Integers begin and end Output: count Algorithm: UnknownErrors a
ID: 3195434 • Letter: I
Question
Input: Positive Integers begin and end
Output: count
Algorithm: UnknownErrors
abegin
if begin>end then aend endif
count0
repeat while aend
aa+2
countcount+1
endrepeat
When UnknownErrors is run with begin=7 and end=15, the output value of count will be:
When UnknownErrors is run with begin=17 and end=2, the output value of count will be:
UnknownErrors is not an algorithm, since it does not terminate for all allowable input values. Give one set of allowable input values for which UnknownErrors does not terminate, and briefly explain why.
Explanation / Answer
[When a=9 , count =1; a=11, count =2; a=13 , count =3]