# (Solved) : Using Excel Background Assume Macro Sub Procedure Called Mainprogram 5 Variables P Q R X Q42747232 . . .

USING EXCEL!!

Background:

– Assume there is a macro (or a sub procedure) calledMainProgram( ).

– There are 5 variables P, Q, R, X and Y in this macro.

– Variables P, Q, R are assigned initial values (Ex: P=10, Q=15and R=20).

– When the MainProgram() macro is run, values of these 5variables

P,Q,R,X and Y will change accordingly. You are asked to fill thevalues for all five variables (P,Q,R,X and Y) at 4 different pointsin time below.

Note: If the value of the variable is “zero” then you must type“0” (without the double quotes, ofcourse). If a variable does nottake any value at any given point, then type “BLANK” (without thedouble quotes). It is important to note that zero and blank are notthe same. Every incorrect variable value will result in losing 1point.

Here is the macro code:

Sub MainProgram ( ) Dim P, Q, R as integer P = 10
Q = 15
R = 20

‘Write down the values of the following 5 variables at thispoint:

P= . Q= ,R= ,X= ,Y=

X=Q–R
Y=P+Q
Q=R-P
‘Write down the values of the following 5 variables at thispoint:

P= . Q= ,R= ,X= ,Y=

P=X+5
Q=Y–3
R = X + Y – 10
‘Write down the values of the following 5 variables at thispoint:

P= . Q= ,R= ,X= ,Y=

Q= X ^ 2
R = SQR (Y) * 2
X = P/R
Y = SQR (Q)
‘Write down the values of the following 5 variables at thispoint:

P= . Q= ,R= ,X= ,Y=

End Sub

SUBMIT SCREENSHOTS

Answer to USING EXCEL!! Background: – Assume there is a macro (or a sub procedure) called MainProgram( ). – There are 5 variables …

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.