I forgot to mention I'm a healthy 17 year old male.
Chest/back pain with inhaling and exhaling is usually due to irritation in the lungs or the linings around the lugs, it's called pleurisy. Heart pain is not usually sharp in nature, it's more of a pressure described as a squeezing or weight on your chest. This sounds more related to your cough than your heart. If you start to experience any other cardiac symptoms like shortness of breath, feeling light headed or dizzy with excessive sweating you should seek medical help. Otherwise, I would call my doctor or his service for advice. I'm not a doctor, you know your body and when something is wrong so you have to act accordingly.
Hope this helps,
Jon