I just bought this car about a month ago (used, obviously) and the engine light just popped on about an hour ago while I was driving. Then, immediately afterwards, I wasn't able to accelerate anymore, it just made the loud revving noise. Someone was nice enough to pull over and run some codes for me and these popped up: P0700, P0715, and P0740.

From what I understand (thanks to Google)...
P0700 just means at least one trans code was thrown, so that's just a standard red flag for a trans problem.
P0715 means there is a problem with the mainshaft speed (either is sensor/wiring is having problems or the trans is failing). That means I'm going to have to flush the transmission and replace the linear solenoid, whatever the heck that is.
The P0740 is a torque converter lockup malfunction. That means the problem is either because the solenoid is defective or it has an internally slipping transmission.

I never noticed there was anything wrong with the car up until tonight, except for faulty brakes.They didn't squeak or anything, it just felt like the pressure was dying when I was at a stop. A friend of mine was supposed to come by and measure the rotors and check the brake pads for me tomorrow, but for now I'm wondering could this be linked to any trans problems? I heard that in some cases for the P0740 there may be performance problems such as dying when coming to a stop after driving on the freeway and/or misfire-like symptoms. Don't know if that could be related at all or I'm just getting ahead of myself.

So my questions are...
About how much is it to flush the transmission and replace the linear solenoid?
About how much is it to rebuild or replace an automatic transmission?
Parts and labor, please?
Could the brake problem be related to the trans?
Is my understanding of the problems correct? My car didn't come with a manual and this is my first car with no knowledgeable car-savvy people around, so ANY information is helpful.

Thanks so much. A million stars for best answer.