Does the computer recognize itself being plugged in? Like does it say plugged in & charging, but just wont go over 17%? If it doesn't recognize the charger even being plugged in, that its probably a bad cable and/or power brick. Batteries and fans are usually the first things to go on a laptop though. After a lot of discharging and recharging, the battery slowly looses it capacity to maintain a charge, similar to a car battery. Usually you can find a replacement battery for less than 50 dollars.
Just an FYI, most laptops will also let you take the battery out completely and just run the computer off the power adapter. Useful if the battery ever dies completely and will not charge.