We study star formation history and stellar metallicity distribution in gal
axies in a Lambda cold dark matter universe using a hydrodynamic cosmologic
al simulation. Our model predicts a star formation rate declining in time e
xponentially from an early epoch to the present on a timescale of 6 Gyr, wh
ich is consistent with the empirical Madau plot with modest dust obscuratio
n. Star formation in L* galaxies continues intermittently to the present, a
lso with an exponentially declining rate on a similar timescale, whereas in
small galaxies star formation ceases at an early epoch. The mean age of th
e extant stars decreases only slowly with increasing redshift and exceeds 1
Gyr at z = 3. Normal galaxies contain stars with a wide range of metallici
ty and age: stars formed at z < 1 have metallicity of 0.1-1.0 Z(.), while o
ld stars take a wide range of values, from 10(-6) to 3.0 Z(.). The mean met
allicity of normal galaxies is in the range 0.1-1.0 Z(.). Dwarf galaxies th
at contain only old stars have a wide range of mean metallicity (10(-4) to
1.0 Z(.)), but on average they are metal-deDcient compared with normal gala
xies.