Question

When Sub Main below is executed, what will be displayed by the two message box? Sub...

When Sub Main below is executed, what will be displayed by the two message box?

Sub Main()
   Dim X As Short = 10
   Dim Y As Short = 20

   Call SomeWeirdMath(X,Y)

   MsgBox (X)
   MsgBox (Y)

End Sub

Sub SomeWeirdMath(ByRef P As Short, ByVal Q As Short)

   P = P*Q

   Q = Q*P

End Sub

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As X is pased as reference. Changing the value of P in SomeWeirdMath() reflects to value of X in Main()

MsgBox 1:
200 is displayed in message box 1

MsgBox 2:
20 is displayed in message box 1
Add a comment
Know the answer?
Add Answer to:
When Sub Main below is executed, what will be displayed by the two message box? Sub...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Visual Basic. 1) 2) 3) What is the value of Adisplayed by the message box? Sub...

    Visual Basic. 1) 2) 3) What is the value of Adisplayed by the message box? Sub Main() Dim A As Single, B As Single, C As Single Test(B,C) MsgBox(A) End Sub Function Test(ByVal B As Single, Byval C As Single) As Single Test B +C End Sub

  • What will be displayed when the sub procedure that follows is run, true or false? Show...

    What will be displayed when the sub procedure that follows is run, true or false? Show all the steps. Option Explicit Sub test() Dim x As Double, z As Double, a As String, b As String x = 7 z = 6 a = "b" b = "a" If Not z > 4 * Atn(1) Or rrr(x) < z Or x > 7 And a > b Then     MsgBox "true" Else     MsgBox "false" End If End Sub Function...

  • Created a userform,but I'm having an issue with one part. I created a few combo boxes and when a user select...

    Created a userform,but I'm having an issue with one part. I created a few combo boxes and when a user selects data from those combo boxes it should Auto populate information that I have stored on a separate Excel sheet into some text boxes that I added next to the combo boxes . One of the combo boxes (cboEmp) is doing excatly what I want it to do,but the other combo box (cboGageNum) is not working properly. I used the...

  • Project 10-1 Convert lengths In this assignment, you’ll add code to a form that converts the valu...

    Project 10-1 Convert lengths In this assignment, you’ll add code to a form that converts the value the user enters based on the selected conversion type. The application should handle the following conversions: From To Conversion Miles - Kilometers: 1 mile = 1.6093 kilometers Kilometers - Miles: 1 kilometer = 0.6214 miles Feet - Meters: 1 foot = 0.3048 meters Meters - Feet: 1 meter = 3.2808 feet Inches - Centimeters: 1 inch = 2.54 centimeters Centimeters - Inches: 1...

  • Use the routine below to: Identify the base case and the code that is executed when...

    Use the routine below to: Identify the base case and the code that is executed when it is true. Identify the general case and the code that is executed when it is true. State what is returned by this routine of its inputs x and y. Routine int Test(int x, int y) { if (y == 0)             return 1; else             return x * Power(x, y-1); }

  • What will the stack contain before INVOKE ExitProcess get executed? 1: main PROC 2: push 10...

    What will the stack contain before INVOKE ExitProcess get executed? 1: main PROC 2: push 10 3: push 20 4: call Ex2Sub 5: pop eax 6: INVOKE ExitProcess,0 7: main ENDP 8: 9: Ex2Sub PROC 10: pop eax 11: ret 12: Ex2Sub ENDP

  • 10. What prints when the following code is executed? public static void main (String args) "Cattywampus"; for (...

    10. What prints when the following code is executed? public static void main (String args) "Cattywampus"; for (int i-s.length )-1 i> 0 i-2) if (s.charAt (i)a') System.out.print(""); ] else if (s.charAt (i)'t') System.out.print (s.charAt (i-2)) i+ti else System. out. print (s . charAt (İ) ) ; if (i<2) System.out.print ("y"); System.out.println () 10. What prints when the following code is executed? public static void main (String args) "Cattywampus"; for (int i-s.length )-1 i> 0 i-2) if (s.charAt (i)a') System.out.print(""); ]...

  • Program using visual basic.net You will create a very simple two numbers calculator with save options;...

    Program using visual basic.net You will create a very simple two numbers calculator with save options; here is the specifications for the application. Create a form divided vertically in two halves with right and left panels 1- In the left panel you will create the following control, the label or the value of the control will be in "" and the type of the control will in [] a- "First Number" [textbox] b- "Second number" [texbox] c- "Result" [textbox] -...

  • 10. What prints when the following code is executed? public static void main (String args) "Cattywampus";...

    10. What prints when the following code is executed? public static void main (String args) "Cattywampus"; for (int i-s.length )-1 i> 0 i-2) if (s.charAt (i)a') System.out.print(""); ] else if (s.charAt (i)'t') System.out.print (s.charAt (i-2)) i+ti else System. out. print (s . charAt (İ) ) ; if (i<2) System.out.print ("y"); System.out.println ()

  • In RobotBASIC what is the best way to solve this random maze generator? cellSize = 80...

    In RobotBASIC what is the best way to solve this random maze generator? cellSize = 80 'pixel size of maze cells mazeWidth = 9 'number of cells horizontally mazeHeight = 6 'number of cells vertically DIM maze[mazeWidth,mazeHeight] 'draw a random maze on the screen Call CreateMaze(mazeWidth,mazeHeight,cellSize) 'place robot in a random location rLocate Random(mazeWidth)*cellSize+cellSize/2, Random(mazeHeight)*cellSize+cellSize/2, 0, 20 Delay 1000 'pause ' YOUR PROGRAM SOLUTION GOES HERE... xyString 0,500,"Done." End 'this must be here! Sub CreateMaze(w,h,s) mConstant maze,0 'zero out entire...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT