Electrical problem with laptop

There are a number of issues that can cause that behavior. Two of the most common on laptops are heat and bad battery. Do you have a means to check your battery voltage? Does it shut down even when plugged into the wall? Can you feel heat coming from the vent on the side (or back) of the laptop?