I hope this is the right place to post this... I'm using VB 2005 Edition.
I'm not trying to get anyone to write full program for me... but anything helps.
I have an assignment due actually quite soon. whats needed in the program is as follows:
The whole concept of the project is so
"Given a positive integer Target, in how many different ways can Target be expressed as a sum of consecutive positive integers?"... The user inputs the number in a test box and the result is displayed in a listbox.
Example of needed process:
if Target = 63, there are six solutions:
3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11
6 + 7 + 8 + 9 + 10 + 11 + 12
8 + 9 + 10 + 11 + 12 + 13
20 + 21 + 22
31 + 32
63
Once I have figured this out... I need to display not only how many different ways there are for the target number, but also I need to display a list similar to what is shown just above. only difference being.. instead of listing all of the combos, display something like
3... 11 (9 Items)
6... 12 (7 Items)
etc...
Total ways: 6
Now I undertsand how to find a set number of consecutive numbers such as
Basic: Target Number = N + (N + 1) + (N + 2)
Rewritten: Target Number = 3N + 3
But understanding that simple equation and then actually writing what I need are 2 completely different things. My guess would be some sort of Do Until or For Each loop.
I know this is a simple project, but I could use all the help I could get.


