The receptacle is a three pronged one. Which is good because that is what my dryer has on the cord. When I moved into this apartment I plugged it in and it shocks me evey time I use it. I turned the Breaker off and pulled the receptacle out of the wall and it has 4 wires coming out of the wall. The black and the red are plugged into each side of the receptacle and the white one is plugged into the bottom. The fourth wire has electrical tape around it and isn‘t plugged into anything. How do I fix this without getting a four pronged receptacle?
There is definitely something kooky going on, you should consider calling an electrician. 4 prong plugs are the standard now, the only difference between the 3 prong and the 4 prong (electrically) is the 4th prong is a non current bearing ground (true ground). That 4th taped wire should be either green or bare copper. If you go back to the box, the red and black should go to each screw of the double breaker, and both the white and green/bare copper should go to the neutral/ground bus bars. Even though both the white and green/bare copper go to the same bar, there still needs to be two of them because the ground circuit is not supposed to be current bearing, so it will be a 'true' ground reference. Dryers are imbalanced loads, so there will be a current on the white/neutral wire (from the timer and drum motors). With 3 wires, if your circuit is not wired correctly, or there is a poor connection on the neutral leg, the chassis of the dryer will 'float' electrically, which is probably exactly what's happening.
Not sure how the apartment got a 3-prong receptacle when there is a ground wire available. If you are getting shocked, something is wired wrong, not because you have a 3-prong receptacle. A 3-prong receptacle is common (only since 1996 has the 4-prong one been required in new homes) and if properly wired will not shock you. Either the receptacle or the dryer is wired wrong. You still may need an electrician. If you switch to a 4-prong outlet, you will need a new cord for the dryer. The process of changing that may fix the problem, but just having a 3-prong outlet is not causing the shocks.
Since you have the fourth wire (the Equipment Grounding Conductor) present in the box, you should purchase the correct 4 prong cord and plug assembly for your dryer and, following the Manufacturer's Instructions, change the cord, and then install the matching grounded receptacle. If you have any doubts about how to do this, call a licensed, qualified electrical contractor. Their may be a ground fault in the appliance that is not opening the breaker because the grounded (neutral) and the Grounding (green or bare copper) are providing a parallel fault current path.