Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Consider the code given below. sub simple calc Dim num As Integer num 20 Call

ID: 3819974 • Letter: 1

Question


1. Consider the code given below. sub simple calc Dim num As Integer num 20 Call Double It ((num) MsgBox num End Sub Sub Double It (var As Integer) var var 2 End Sub When this program is run, the following will be displayed in a message box (A) 0 (B) 2 (C) 20 (D) 40 (E) None of the above 2. Consider the code given below. sub simplecalc Dim num As Integer num 20 Call DoubleIt (num) MsgBox num End Sub Sub Double It (var As Integer) var m var 2 End Sub When this program is run, the following will be displayed in a message box: (A) (B) 2 (C) 20 (D) 40 (E) None of the above

Explanation / Answer

1. A 0 is diplayed since in double it ( (num) ) function only 1 integer is declared but a null value is called in the function so it functions like double it (0,num) and accordingly it calls 0 to the procedure and gives o/p as 0*2=0 and 0 is displayed in message box

2.D 40 is diplayed as num is called as var and num=20 ,so var=20*2 =40 and 40 is displayed in message box.

3.E none since it runs 3 times until 0 at i={5.3.1} in loop

4.B Returns value of A1 as 4 since z=y-x where y=10 and x=6 i.e, 10-6=z=4

5.C

6. B Acc to BODMAS rule answer is saved as -16

7.B all the right letters(4) are changed to upper case