Galaxy Evolution in Cosmological Simulations with Outflows II: Metallicities and Gas Fractions