Results 1 to 7 of 7

Thread: need help evaluating a couple things

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    10

    need help evaluating a couple things

    1.
    Evaluate:
    A<=B AND B>=A, if A=12, B=6 and C=8

    my answer: A<=B AND B>=A returns False

    but why is C=8 there.........

    2.
    if A = "You are doing" and B = "programming", evaluate A+B and A&B

    ii) Is the operation A-B possible?

    Any help appreciated

  2. #2
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: need help evaluating a couple things

    Quote Originally Posted by lgwo06
    ...
    but why is C=8 there.........
    ...
    Maybe it's there to throw off the right track those who are not confident about their understanding. But are you sure you have transcribed it correctly?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    10

    Re: need help evaluating a couple things

    hmmm well after figuring it out in math terms it came close to c=8 but thats math not vb terms which is why i asked this question.......I gotta get 80% man......to be accepted in a particular study class, which I really want to be apart of......I don't expect an answer but I'd like some help to figure these 2 things out ......how do I do it?

  4. #4
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: need help evaluating a couple things

    Quote Originally Posted by lgwo06
    1.
    Evaluate:
    A<=B AND B>=A, if A=12, B=6 and C=8

    my answer: A<=B AND B>=A returns False

    but why is C=8 there.........

    2.
    if A = "You are doing" and B = "programming", evaluate A+B and A&B

    ii) Is the operation A-B possible?

    Any help appreciated
    1) Is this what you want?
    Code:
    Dim A As Integer
    Dim B As Integer
    Dim C As Integer
    
    A = 12
    B = 6
    C = 8
    
    Msgbox CBool(A <= B And B >= A)
    2) How are + and & to be interpreted? If it's as VB operators then,
    Code:
    Dim A As String
    Dim B As String
    
    A = "You are doing"
    B = "Programming"
    
    Msgbox A + B & vbCrLf & A & B
    I don't know what the minus sign could mean applied to strings.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    10

    Re: need help evaluating a couple things

    For the 1st question the hint was to break the equation into simpler form using AND or OR operators to evaluate. The answer should evaluate to True or False.

    For the 2nd question I for some reason thought it would be something like:

    A + B = "You are doing programming" or something along those lines.....but I doubt it....I'm actually reading some things on vb online so hope I'll get an idea after reading through a few of those...

    Thanks

  6. #6
    Hyperactive Member metalmidget's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    342

    Re: need help evaluating a couple things

    Maybe it's there to throw off the right track those who are not confident about their understanding. But are you sure you have transcribed it correctly?
    Not knowing what sort of level of maths you're working at, I would assume that yes, this is the case.
    For question 2, i think they just want to see you distinguish between the different operators (if this is VB-related). So try a program to do the operations and see what results you get:
    VB Code:
    1. dim A as String
    2. dim B as String
    3.  
    4. Private Sub Form_Load()
    5. A = "You are doing"
    6. B = "programming"
    7. Msgbox A+B
    8. Msgbox A&B
    9. Msgbox A-B
    10. End Sub

    Let me know if anything doesn't make sense

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    10

    Resolved Re: need help evaluating a couple things

    Hi, thanks alot to the both of you for helping me with these equations.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width