Before I go any further, this IS apart of my homework.The part that I am having trouble with however, is not the main point of the assignment.
For the assignment we are just storing numbers in an array, and am adding up the elements of the array via multithreading.
The user enters how many threads that they would like to run, and what the upper bound should be.
For example: Upper Bound: 12 Threads: 2 The application should add up elements 1-6, then 7-12. In this case the lower bound starts out at 1 and the upper bound starts out at 6. Then the second time the loop should iterate the upper bound should be 7 and the upper bound should be 12.
I am having trouble trying to divide the upper bound by the number of threads to create the increments in which the lower and upper bounds are based off of.
It is fairly simple if the number of threads divides evenly into the starting upper bound. But when It doesn't is when I am having the problem.