Not Yet Answered # advice on programming

masijade 1,351 Discussion Starter ubi_ct83 -3 masijade 1,351 Stefano Mtangoo 441 Discussion Starter ubi_ct83 -3 Discussion Starter ubi_ct83 -3 OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...

0

Post your algorithm and we will, probably, give you hints and nudges to help you increating a method that implements it.

0

if i have these inputs:

A:a1,a2

B:b1,b2,b3

C:c1,c2

D:d1,d2,d3

FYI, a1,a2,b1,b2,c2,c1 and the rest are values

and i have this interactions:

1)1,1,1,0

2)1,1,0,1

3)1,0,1,1

4)0,1,1,1

base on 1st interaction:

my algorithm is:

A=value B x value C

B=value C

C=alternately

D=x

The total result=value A x value B x value C

and the result for interaction 1,1,1,0 is:

a1,b1,c1,X

a1,b1,c2,X

a1,b2,c1,X

a1,b2,c2,X

a1,b3,c1,X

a1,b3,c2,X

a2,b1,c1,X

a2,b1,c2,X

a2,b2,c1,X

a2,b2,c2,X

a2,b3,c1,X

a2,b3,c2,X

A=2 x 3=6 (6 (a1) and 6 (a2))

B=2 (2 (b1),2(b2) and 2 (b3)

C=1 alternately c1,c2

D=x

The total result=2 x 3 x 2= 12 (row of combination)

the rest interaction:

1,1,0,1

A=value B x value D

B=value D

C=X

D=alternately

The total result=value A x value B x value D

1,0,1,1

A=value C x value D

B=X

C=value D

D=alternately

The total result=value A x value C x value D

0,1,1,1

A=X

B=value C x value D

C=value D

D=alternately

The total result=value B x value C x value D

0

Create a 2D array where your "inputs" are the "subarrays". Then the interactions are a boolean array where true indicates that the array in that index of the "first" dimension of the 2d array should be used. Then, for the iterations, you write a triple loop outputting the first indexed arrays "current" value with the second indexed arrays "current" value, with the third indexed arrays "current" value and "X" from inside the third loop. Then, for the math, the first "value" is the length of the first indexed array times the length of the second indexed array and the second value is the length of the third indexed array and the total value is both of those values multiplied together.

Now, take that description and attempt to implement it.

0

Create Class Diagrams or whatever will help you to show needed Classes and methods.

Then Go ahead and code those methods. Review your code, and make necessary changes until you think it is good now.

Design->Code->Debug->Release

That is how I undertake such tasks

0

Create Class Diagrams or whatever will help you to show needed Classes and methods.

Then Go ahead and code those methods. Review your code, and make necessary changes until you think it is good now.Design->Code->Debug->Release

That is how I undertake such tasks

its a general advice but its good for me since i have no idea at all to start coding.

Thanks

0

Create a 2D array where your "inputs" are the "subarrays". Then the interactions are a boolean array where true indicates that the array in that index of the "first" dimension of the 2d array should be used. Then, for the iterations, you write a triple loop outputting the first indexed arrays "current" value with the second indexed arrays "current" value, with the third indexed arrays "current" value and "X" from inside the third loop. Then, for the math, the first "value" is the length of the first indexed array times the length of the second indexed array and the second value is the length of the third indexed array and the total value is both of those values multiplied together.

Now, take that description and attempt to implement it.

ok,i think i understand ur idea.what if i have input like A,B,C,D and E and the binary is 11110,11101,11011,10111,01111. and the algorithm is still the same.but in this case, ihave more than 3 '1'.since like i cant have triple loop isnt?

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

I don’t want at this stage work on a big separate project as I've already got plenty ...

Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.

btn_addline :

`Private Sub btn_addline_Click(ByVal ...`