0

Dear all
i have to do the exercise. The check boxes have 5 items: item 1, item2,..., item 5. Each item have one value. These values is in the range from 500 to 600.
There are 5 variables x, y, z, p, q.
The connstant number is 1800
When 3 items are checked, such as item 1 item 2, item 3, the program will generate x,y,z. And
item 1 * x+ item2*y+item3*z=1800
The same if 4 and 5 items are checked.
If 1 or 2 items are checked, the program will alert error.

I cannot do this exercise. I am waiting for anyone's help.
Thanks alot.

2
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by long_vn
0

Hi,

u want a Random Number generator or logic to solve the Algebric Expression..?
not very clear with ur question..

Regards
Veena

0

Firstly, I want to generate random numbers for items ( 1 to 5). they are in the range (500-600)
secondly, to solve the Algebric Expression.
Please hlep me.

0

Hi,

To get random numbers, first Create a Function:

Public Function Rand(ByVal Low As Long, _
                     ByVal High As Long) As Long
  Rand = Int((High - Low + 1) * Rnd) + Low
End Function

To Get five numbers,

dim N1,N2,N3,N4,N5 as long
N1 = Rand(500, 600)
N2 = Rand(500, 600)
N3 = Rand(500, 600)
N4 = Rand(500, 600)
N5 = Rand(500, 600)
' 
Randomize
'

after this, it would be easy to solve the expression...

Regards
Veena

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.