Question: how do u know if its the battery or alternator?
Answer: If the battery is working properly and nothing is wrong with it, then it's the alternator that will more likely cause a problem. A simple test to check the working of the alternator is by running your car; and then unplugging the positive connection of the battery.