The main purpose of a dike is protecting the land behind it from flooding, whereas a dams' purpose is to retain the water.
Hope this answer helps! feel free to ask any additional questions :)
Also if you are good at Geometry, would you mind seeing if you could answer some of the questions on my profile?