hello im hoping i can receive some insight on my current problem i was required to write a program that takes a baseball players statistics and displays there averages. i was required to make 3 function in the file to perform this tasks. my problem i am having a division problem in the SLG function and for the life of me cannot figure out what i have done wrong the two functions above it are working flawlessly. i hope one of you can help me out thank you.My compiler does not require the system ("PAUSE"); command.OUTPUT
The player's batting average is: 0.347
The player's on-base percentage is: 0.375
The player's slugging percentage is:
(test)AB = 101
(test)Tot Base = 58
0.000

my problem i am having a division problem in the SLG function and for the life of me cannot figure out what i have done wrong

Use the debugger that comes with your compiler.

Quote:

the two functions above it are working flawlessly.

Well, learning how to fix problems is part of learning how to program. You wrote the function and it doesn't give you the correct results, so which one of those variables in that SLG function is incorrect? That is what the debugger is used for.

Also:

1) Drop the usage of the variables with leading underscores. In C++, identifiers with leading underscores are reserved for the compiler library usage. Use variable and function names that are both descriptive (not these two or three letter names), and do not start these names with underscores. For example, call your function "BattingAverage", not "BA". Doing that alone can reveal mistakes.

2) You don't check whether you are dividing by 0 in any of the calculations.