A. Causes of coughing in dogs include infectious disease (kennel cough as mentioned below, but also more serious diseases like canine influenza, heartworm disease, lungworms), aspiration pneumonia, heart disease, allergic disease, and other immune-related diseases like inflammatory bronchitis. You didn't mention her age, but cancer could also be a concern. It's hard to say specifically what's going on, but from your description it sounds like she's systemically ill (loss of appetite), so I would recommend seeing a vet so that diagnostic tests can be run to try to determine what's going on.
A. It could be kennel cough. It's a dry hacking followed by a gagging and pretty common for shelter dogs.
I would recommend calling the agency you adopted her from, as lots have a short term health check up allowance and they may be able to further assist you. They should also be made aware if she does have it as its contagious.
Your account has been reactivated.