Wow Talk about a stab in the dark!! I would open the capped 2" pipe and see if it has a trap under the slab. If it does it looks like a tub drain. If it doesn't I would guess vent for toilet. My best guess is the black pipe is a cleanout. But in till you open the pipe you will not Know. I suggest calling a plumber who has a video inspection camera to figure it out, Probably cheaper to have him finish the plumbing for you than making mistakes.