im trying to output the percentage of money each person will get, so i enter an amount in the beginning and all of the team members and then it outputs everyones pay but i cant seem to get it to do that.
What is it you're trying to achieve with the condition on the second line of that snippet? Do you really want to use the comma operator there? I suspect you've misunderstood what the comma operator does, because it's hard to see how it makes sense there.
I dont know what i mean by that, i guess i really dont know what it does. I dont know that either, someone told me the way i was reading values in a vector was wrong and so they gave me a link and i followed it exactly.
Ok i read up on it and it is a seperator in some contexts but an evaluator in most contexts. i see now. well that for loop is supposed to output the contents of the vector so i guess i could do a nested for loop but isnt there a way to do an advanced for loop with that code? thats what i was trying to do but i guess that wont work, so i guess this would be the more sensible solution?
If you do a nested loop, then what well happen is that the inner loop will loop over all the members of vect_percentage for every member of vect_Employees. So if there were 5 elements in vect_Employees and 7 elements in vect_percentage then the inner loop would iterate 7 times for vect_Employees, then another 7 times for vect_Employees, etc - for a total of 35 times.
No i want it to show the names of the employees stored in vect_Employees, then calculate the percentages i entered for each person to see what they would get out of the amount of money i entered in the beginning, so lets say i enter $900, then i enter the employees names, then the percentage of work the employees did, then the program calculates what percent they would get and output it.
Well, the devil is in the details. From the way you've described it, it sounds like the output would look like:
Whereas from looking at your code, it looks like what you're trying to get is:
Since there is a direct one-to-one relationship between employee and percentage, why are you confusing things by trying to manage two vectors at once? Why not have a struct that contains the name and the earnings of each employee, and then have a single vector of structures? That way, you only have to manage a single iterator.
I'm saying that instead of having one vector that contains names, and another that contains earnings, you should define a struct type that bundles together that information for an employee, and then have a single vector of those structs.
Make a single vector of Employee structs, rather than the two vectors you have now, so you only have to worry about iterating over a single vector. Store the name and percentage of each employee in the struct for that employee.
If you don't know how to use structs, then I'll reiterate my previous comment:
you'd be better off reading a proper C++ book to learn this stuff, rather than asking piecemeal questions on a forum.
Edit: you say you have a games company - you mean a computer games company? As in, you have actual software developers already working for you?