My computer turns off completely at times while i'm
working on it. It sometimes goes 48 hrs without stop-
ping and sometimes it stops after 30 min use. I bought
a new battery, but the problem is still here. I then
bought a new power cord, but again the problem is
still with me. Can anyone help me with possible suggestions on how to fix this problem.

Is it just shutting down or is it restarting? If it is shutting down it could be a power supply problem Also is it a sudden shutdown or does it go into windows shutdown?

if it is just shutting down, the problem might be the cpu is over heating so maybe the heat sink has a problem or your operating system is corrupt. you can try repairing it

you can try to do a virus scan...maybe some virus or malware is messing up with your system.. try to download MalwareBytes :)

Could you please post a full system spec. Operating system, Ram ,Cpu etc..

Did you buy this computer whole or did you build it yourself?
When did this start to happen? was it after installing something or maybe applying some system updates.

Have you tried the laptop without the battery and powered soley off the battery?

Does it get very hot before turning off?

- Let us know