Well, I didn't put the endl; . My professor wants us to keep the names and stats on the same lines. But yes, that is what it would have been had I used the endl; .
I basically wanted to put the on-base percentage at the end of each line. When I use that formula, they all come out to "0". When, for example, the first player's on-base percentage should be what 18/39 comes out to. Even if I set obp to (18) / (39), it comes out to 0.
Thanks for sticking with my question despite initial confusion due to wording on my part. This has helped me a bunch! I now have enough information to finish the project myself, thanks!