PDA

Click to See Complete Forum and Search --> : need help evaluating a couple things


lgwo06
Sep 5th, 2007, 10:35 PM
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

krtxmrtz
Sep 6th, 2007, 04:36 AM
...
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?

lgwo06
Sep 6th, 2007, 06:12 AM
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?

krtxmrtz
Sep 6th, 2007, 06:51 AM
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?

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,

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.

lgwo06
Sep 7th, 2007, 08:14 PM
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

metalmidget
Sep 9th, 2007, 07:26 AM
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:
dim A as String
dim B as String

Private Sub Form_Load()
A = "You are doing"
B = "programming"
Msgbox A+B
Msgbox A&B
Msgbox A-B
End Sub

Let me know if anything doesn't make sense

lgwo06
Sep 12th, 2007, 08:42 PM
Hi, thanks alot to the both of you for helping me with these equations.