Chosen Solution

my laptop keeps on displaying “calculating” then ”not charging” when i remove the charger the laptop switches off. could the problem be the battery or the charger

The charger is fine as it’s allowing the laptop to power off the wall charger. Try a replacement battery and see how it goes. Worst case scenario would be the battery charging circuit that has gone bad but that is unlikely.