|
-
Apr 7th, 2006, 08:03 PM
#1
Thread Starter
New Member
conditions
Write a condition to express the following:
X is strictly between -10 and 10.
Exactly one of X and Y is greater than 6.
Both X and Y are positive or both X and Y are negative.
-
Apr 7th, 2006, 08:15 PM
#2
Hyperactive Member
Re: conditions
could you please tell more about your case? when will this happen? X and Y should be assigned random values matching this conditiones? or what?
-
Apr 7th, 2006, 08:16 PM
#3
Frenzied Member
Re: conditions
maybe this could help
VB Code:
If (x >= -10) And (x <= 10) Then
'x is between -10 and 10
Else
'x is not between the 2 values
End If
If (x > 6) Or (y > 6) Then
'one or both x and y > 6
End If
If (x >= 0) And (y >= 0) Then
'both x and y are positive
ElseIf (x <= 0) And (y <= 0) Then
'both x and y are negative
End If
'they have different signs
End Sub
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Apr 7th, 2006, 08:23 PM
#4
Thread Starter
New Member
Re: conditions
 Originally Posted by d3gerald
maybe this could help
VB Code:
If (x >= -10) And (x <= 10) Then
'x is between -10 and 10
Else
'x is not between the 2 values
End If
If (x > 6) Or (y > 6) Then
'one or both x and y > 6
End If
If (x >= 0) And (y >= 0) Then
'both x and y are positive
ElseIf (x <= 0) And (y <= 0) Then
'both x and y are negative
End If
'they have different signs
End Sub
That is all the information I have on this question. Thanks for your response.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|