So, I'm trying to figure out the amount of money a Golf player receives according to their position. However, often we have many players who end up in the same positioning.
For example, sometimes there are 2 people in 1st place, 2 people in 2nd place, and 3 people in 3rd place. In this situation, we'd give 80% of the money split to first, and 20% of the money split to second, excluding 3rd place. Situation where it's 5 people in 1st, 2 people in 2nd, and 3 in 3rd, therefore making the pot be split within the first 5 people. The Pot itself is altered every day, as every player chips in every new game.
Here's my code so far, and It doesn't work :( Help?
int FiftyPercent(int a)
int FiftyPercentSplit(int A, int B)
int ThirtyPercent(int b)
int TwentyPercent(int c)
int DividedFirst(int e, int f) //This regards when the first place has 2 in 1st, and 1 or more in second.
int DivideSecond (int E, int F)//This regards when the first place has 2 in 1st, and 1 or more in second.
cout << "There are too many winners in first place, therefore the pot is split between them.";
int main ()
cout << "Please enter the total pot: ";
cin >> Pot;
cout << "The total pot is: " << Pot <<endl;
cout << "\n Please enter the amount of players in first place: ";
cin >> Player;
cout << "\n Please enter the amount of players in second place: ";
cin >> Player1;
cout << "\n Please enter the amount of players in third place: ";
cin >> Player2;
cout << "\n The first place winner receives " << FiftyPercent(Pot)<<endl;
if (Player ==2)
cout <<"\n The first place winner receives " << DividedFirst(Pot,Player) <<endl;
if (Player ==3)
if (Player ==1,&&Player1>=2)
cout << "\n The second place winners split the pot with; " << FiftyPercentSplit(Pot,Player1) <<endl;
if (Player ==1,&&Player1==1,&&Player2>=1)
cout << "\n The third place winner receives: " << TwentyPercent(Pot)<<endl;
Please use code tags, if you want any help.
To insert code tags, hit edit in the post above this one, and on the right hand side you should see something like:
click it and insert all your code in between it.
also, please read this: http://www.cplusplus.com/forum/beginner/1/
It's a simple enough program that this should suffice.
You could, if you want put the logic asking the user for information in a separate function, as well as the logic displaying the info to the user, but for a small structured program like this I would say that's not vital.