chevy cobalt electrical issue

car refuses to start sometimes,flashes warning lights sometimes,always honks horn when door opens. can this be due to the battery located in the trunk losinng contact ?