Answer Q1(a) and Q1(b)(i)-Q1(b)(x) based on the information given in Figure Q Figure Q1 Write the output for the program
Posted: Tue Jul 12, 2022 8:28 am
Write the output for the program in Figure Q1. (10 marks) Determine whether each of the following statements is TRUE or FALSE. (i) The callmel () and callme3() functions benefit from the use of recursive implementation. (2 marks) (ii) The callme3 () function is a non-recursive implementation of callme2() function. (2 marks) (iii) Given a value n, both callme2 (n) and callme4(n) will return same result. (2 marks) (iv) Given x=5, both callme2 (x,3) and callme 4(5,n1−1) will return same result. (2 marks) (v) Given a value n, both callme2 (n) and callme4 (n) will return same result. (2 marks) (vi) Given a value n, both callmel (n,3) and callme4 (n,3) will return same result. (2 marks) (vii) The callmel() and callme2 () subroutines demonstrate implementation of recursive functions. (2 marks) (viii) The callmel () and callme2 () subroutines demonstrate implementation of recursive functions because both return a single value only. (2 marks) (ix) The callme3 () and callme4 () subroutines demonstrate implementation of non-recursive functions. (2 marks) (x) The callme3 () and callme4 () subroutines demonstrate implementation of non-recursive functions because both have valid parameters. (2 marks)