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.

Hi,

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

Regards
Veena

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.

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

Thanks you very much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.