Given the names of ionic compounds, covalent compounds, acids and diatomic gases, determine the formula.