SO i have to add each person's final total of sum together and if it exceeds the winner then it should print out "it took number 1 - k" k being the last person it took to exceed the winners total. Im having issues on how to add the final sum together and its confusing me. Any insights would be appreciated.
This is what i have so far
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
int sumofFinal;
int k;
int sum = 0;
for (int t = 0; t < 10; t++)
{
if (IDD == Programmer[t].ID)
sum += Programmer[t].lineOfCode;
if (Programmer[t].lineOfCode > sumofFinal)
{
k = IDD;
cout << k;
}
}
So i have already found the winner and added the sum of each person. Now i have to add the sum of each person again and see how many people it took to exceed the sum of the winner. I hope this solve any confusion
Do you want a sample of the output? The winner is 9 btw so i would need to write a code that prints out "it took 1-7 to exceed the winner". Thats where im stuck on i have been thinking about it