Help with vb code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • auntberber
    New Member
    • Oct 2006
    • 1

    #1

    Help with vb code

    Hi,

    I'm new to programming, and I need to make a program ask a question with 2 random variables. The question "How much is x times y?" where x & y are random variables. I am stumped at how to code this in Visual Basic.

    Thanks for any help you can give me.

    Aunt Berber
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by auntberber
    Hi,
    I'm new to programming, and I need to make a program ask a question with 2 random variables. The question "How much is x times y?" where x & y are random variables. I am stumped at how to code this in Visual Basic.
    Thanks for any help you can give me.
    Aunt Berber
    Which parts do you need help with? Here's a simple piece of code to create the question in a String variable...
    Code:
    Dim X As Long, Y As Long, S As String
    Randomize
    X = Rnd * 100
    Y = Rnd * 100
    S = "How much is " & Format$(X)" & " times "  & Format$(Y)" & "?"

    Comment

    Working...